Tagged Questions
2
votes
2answers
2k views
Passing a variable to a bash script when sourcing it in another bash script?
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 ...