[plug] Bash scripting error with functions

Craig Ringer craig at postnewspapers.com.au
Sun Jun 12 20:16:30 WST 2005


On Sun, 2005-06-12 at 21:38 +0930, Onno Benschop wrote:
> Can someone explain to me why the following script returns:
> 
>     xargs: make_file_link: No such file or directory

[craig at albert ~]$ function fred() {
> echo fred
> }
[craig at albert ~]$ fred
fred
[craig at albert ~]$ bash
[craig at albert ~]$ fred
bash: fred: command not found

Functions don't seem to be inherited. Chances are that xargs uses a
subshell, or just looks for the command directly, and it won't be able
to call `make_file_link' from the parent process (shell).

-- 
Craig Ringer




More information about the plug mailing list