[plug] calling a script within a script

Jonathan Young jonathan at pcphix.com
Thu Dec 8 20:31:18 WST 2005


Jon Miller wrote:

>Like to know how do I call a script (backup1-functions) within a script (backup1.sh).  Within the backup1-functions script there are other functions.  
>
>Tried the following
>. backup1-functions
>  
>
used for setting variables

>./backup1-functions
>  
>
means the script is in the current directory (this might not be the case)

>. ./backup1-functions
>  
>
a combination of both

>I get the same response:
># ./backup1.sh
>./backup1.sh: line 21: ./backup1-functions: No such file or directory
>./backup1.sh: line 24: tar_backup: command not found
>./backup1.sh: line 27: tar_verify: command not found
>
>  
>
Sounds like the script is not located where you think it is - i.e. the 
same directory as you are running "backup1.sh" from...

Just a stab in the dark anyway.  It sounds like I'm stating the obvious, 
so if there is nothing new in my answer, I'll leave it to the rest of 
PLUG to tackle.

I'm still fairly new to bash scripting and must admit, I haven't tried a 
script from within a script yet...

-- 
Jonathan Young
Director of PC-PHIX
jonathan at pcphix.com

Phone: 0410 455 674
Web: http://www.pcphix.com/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.plug.org.au/pipermail/plug/attachments/20051208/1dc54d4e/attachment.html>


More information about the plug mailing list