[plug] script problem

Cameron Patrick cameron at patrick.wattle.id.au
Fri Jul 15 19:28:23 WST 2005


Jon L. miller wrote:

> ## read in file with functions
> /backup-functions

If you want to read the functions file with the current shell, you'll
have to use the '.' or 'source' command (the latter being a bash
specific extension, the former the POSIX standard that works
anywhere), e.g.:

    . /backup-functions

Otherwise, the backup-functions file will be executed in a subshell
with an independent environment and so the functions defined there
won't be available in the calling script.

Also, keeping the functions in the root directory feels a bit ... icky.

> # run the backup from the backup-functions file
> tar_backup ()

To call a shell function, you don't need the brackets, so that should
be just:

    tar_backup

HTH,

Cameron.




More information about the plug mailing list