I think it's better to save the file in a common well known location such as $HOME.
So, the first script will do:
Code:
echo $2 > $HOME/path.info
and the second will put the ouptup of path.info in a variable (let's say $script_path)
Code:
script_path=`cat $HOME/path.info`
or
Code:
script_path=$(cat $HOME/path.info)
Don't use the ~ (tilde) in scripts to indicate HOME path, but use $HOME since some shells mess with it.