Er.. There is a question with almost the same title on stackoverflow, but there is a difference in my question. My code is this
cd /oracle_data/indata/VXMLIVR
ls -d SMSR > temporary4.txt
while read smsr_line;do echo $smsr_line;cd $smsr_line;./smsr_alarm;cd ..;done < temporary4.txt
ls -d SMSC > temporary3.txt
while read smsc_line;do echo $smsc_line;cd $smsc_line;./smsc_alarm;cd ..;done < temporary3.txt
ls -d HCIVR5 > temporary.txt
while read hcivr_line;do echo $hcivr_line;cd $hcivr_line;./hcivr_alarm;cd ..;done < temporary.txt
ls -d HCIVR6 > temporary.txt
while read hcivr_line;do echo $hcivr_line;cd $hcivr_line;./hcivr_alarm;cd ..;done < temporary.txt
ls -d HCIVR7 > temporary.txt
while read hcivr_line;do echo $hcivr_line;cd $hcivr_line;./hcivr_alarm;cd ..;done < temporary.txt
ls -d HCIVR8 > temporary.txt
while read hcivr_line;do echo $hcivr_line;cd $hcivr_line;./hcivr_alarm;cd ..;done < temporary.txt
ls -d IVR* > temporary2.txt
while read ivr_line;do echo $ivr_line;cd $ivr_line;./ivr_alarm;cd ..;done < temporary2.txt
rm temp*
I have saved this script as vas_alarm. when i remove the first line(cd /oracle_data/indata/VXMLIVR), manually do cd /oracle_data/indata/VXMLIVR and run ./vas_alarms everything works fine. But when i run the entire script like this:
oracle@sunv440$/oracle_data/indata/VXMLIVR/vas_alarms
: No such file or directory/vas_alarms: line 1: cd: /oracle_data/indata/VXMLIVR
im getting an error. Where am i going wrong? The thing is my script is saved in /oracle_data/indata/VXMLIVR and i need to run it after entering this location. Also the script has to be saved in a cron file. Any workarounds will also do. My main aim is to schedule /oracle_data/indata/VXMLIVR/vas_alarms
This happens when you have some invisible characters in your file.
For example:
You can use
xxd/hexdump/odto view the binary presentation:xxdwill print all unprintable charactors as.s(dots).Notice that these’s a
.(dot) at the beginning.