Results 1 to 4 of 4
Hi
I'm having a bit of trouble with including a bash shell script within another and was hoping that someone could help?
I have created a script of utility functions ...
- 02-17-2010 #1Just Joined!
- Join Date
- Feb 2010
- Location
- Raleigh, NC
- Posts
- 3
error when using "source utility_script.sh" in main_script.sh
Hi
I'm having a bit of trouble with including a bash shell script within another and was hoping that someone could help?
I have created a script of utility functions that I'd like to incorporate into other scripts so that they can use the functions, but I can't get it to work.
This is what is in the utility_script.sh
This is what I've done in the main_script.shCode:#!/bin/bash # other comments echo "inside utility script" my_utility_function() { # do stuff return }
The error I get is "my_utility_function: command not found", and it doesn't echo the line that shows that it is in the utility script at all.Code:#!/bin/bash # other comments source /full_path_to_script/backup_utils.sh my_function() { my_utility_function "params" return } my_function "params"
Please can you help me with what I may be doing wrong?
Thanks
- 02-17-2010 #2Linux User
- Join Date
- Nov 2009
- Location
- France
- Posts
- 292
Are backup_utils.sh and utility_script.sh the same ?
0 + 1 = 1 != 2 <> 3 != 4 ...
Until the camel can pass though the eye of the needle.
- 02-17-2010 #3Just Joined!
- Join Date
- Feb 2010
- Location
- Raleigh, NC
- Posts
- 3
- 02-17-2010 #4Just Joined!
- Join Date
- Feb 2010
- Location
- Raleigh, NC
- Posts
- 3
OK, I have no explanation for this because I didn't do anything (except to try and run it again after lunch), but it now seems to be working.

Thanks to everyone who looked at this.


Reply With Quote
