I have a script as follows which as part of its function tries the following

MYFILE="~/myprogram/datafile"if ! [ -e "$MYFILE" ]; then echo file $MYFILE not therefiunfortunately, the ~ is not expanded to /home/usernameand so the file is never found.the MYFILE variable value may have spaces in it. eg "~/my nasty path/yuck data"

Any clues on a generic way to expand the path in the variable would be appreciated. thanksTim

Who is online

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum