- create a functions directory
$ cd
$ mkdir myfunctions
$ cd myfunctions
- create two files in the myfunctions directory
$ touch hello1 hello2
- here are the contents of hello1
function hello1
{
print "hello1 fxn"
}
- here are the contents of hello2
function hello2
{
print "hello2 fxn"
}
- add the following lines to your $ENV file
FPATH=$HOME/myfunctions
export FPATH
autoload $(ls $FPATH)
- create a script inside the derek directory
$ cd
$ cd derek
- here are the contents of the script called hello.sh
#!/usr/bin/sh
print "inside the the $0 script"
hello1
hello2
- now run the hello.sh script