Suppose I have in main.sh:
NAME="$HOME"
if [ -f "$HOME/install.sh" ]
then
. "$HOME/install.sh" "$NAME"
fi
and in install.sh:
echo $1
This is supposed to echo /home/user/
, but it echoes nothing. Why?
feedback
|
Michael Mrozek covers most of the issues and his fixes will work since you are using Bash. You may be interested in the fact that the ability to source a script with arguments is a bashism. In When you source the script in
| |||||
feedback
|
I see three errors:
| |||||||||
feedback
|