I am new to shell scripting so I assume there is something basic I am missing but I have not been able to figure it out. When I run the following code from a script it can't find the paths to the directory or files. I can literally cut and paste the commands into terminal and they work fine. Why can't these paths be found when run from a script? I have done chmod 755 getup.sh.
#!/bin/bash
MC2XML="/Users/ericphil2/Scripts/mc2xml"
XMLTV="/Users/ericphil2/Scripts/xmltv.xml"
#Set the working directory
cd /Users/ericphil2/Scripts
#Get new schedule
$MC2XML -J -c us -g 14519
#Reload EyeTV with the file
open -a EyeTV $XMLTV
This the response from running the script:
[MacPro:~/Scripts] ericphil2% sh ./getepg.sh
: No such file or directorysers/ericphil2/Scripts
: No such file or directory/ericphil2/Scripts/mc2xml
does not exist.ericphil2/Scripts/