Instead of writing tons and tons of small scripts < 10 lines that all depend on each other I have the habbit of writing them as functions and throwing them into one file (easier to edit, less worries about them depending on each other). To be able to use the functions from the bash shell, just add $(basename $0) “$@” to the END of the file, and add symlinks function_name -> file.
Example:
$ ln -s foo.sh foobar
$ cat foo.sh
Select All Code:
1 2 3 4 5 6 7 | #!/bin/bash foobar() { echo "world domination" return } $(basename $0) "$@" |
More From dopefish
dopefish Recommends
- WinSock Repair (Rizonesoft)
- 性交顧客 – Is Japanese for “Fuck the Customer” (b1ackcr0w)



No Comments on "bash foo"