Note that there are some explanatory texts on larger screens.

plurals
  1. POcd not working as intended in bash script
    primarykey
    data
    text
    <p>Er.. There is a question with almost the same title on stackoverflow, but there is a difference in my question. My code is this</p> <pre><code>cd /oracle_data/indata/VXMLIVR ls -d SMSR &gt; temporary4.txt while read smsr_line;do echo $smsr_line;cd $smsr_line;./smsr_alarm;cd ..;done &lt; temporary4.txt ls -d SMSC &gt; temporary3.txt while read smsc_line;do echo $smsc_line;cd $smsc_line;./smsc_alarm;cd ..;done &lt; temporary3.txt ls -d HCIVR5 &gt; temporary.txt while read hcivr_line;do echo $hcivr_line;cd $hcivr_line;./hcivr_alarm;cd ..;done &lt; temporary.txt ls -d HCIVR6 &gt; temporary.txt while read hcivr_line;do echo $hcivr_line;cd $hcivr_line;./hcivr_alarm;cd ..;done &lt; temporary.txt ls -d HCIVR7 &gt; temporary.txt while read hcivr_line;do echo $hcivr_line;cd $hcivr_line;./hcivr_alarm;cd ..;done &lt; temporary.txt ls -d HCIVR8 &gt; temporary.txt while read hcivr_line;do echo $hcivr_line;cd $hcivr_line;./hcivr_alarm;cd ..;done &lt; temporary.txt ls -d IVR* &gt; temporary2.txt while read ivr_line;do echo $ivr_line;cd $ivr_line;./ivr_alarm;cd ..;done &lt; temporary2.txt rm temp* </code></pre> <p>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:</p> <pre><code>oracle@sunv440$/oracle_data/indata/VXMLIVR/vas_alarms : No such file or directory/vas_alarms: line 1: cd: /oracle_data/indata/VXMLIVR </code></pre> <p>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</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload