Posted by: Tim
Bizarre C-Shell Script Problem - 03/05/2012 11:51
This is just baffling. As part of a software installation package, I have a series of C-Shell scripts. The main script calls the rest.
The issue I am having is that the main script isn't calling the embedded one. The call looks like this:
The variable media is defined correctly and the echo before the call looks good. Then, inside the check_os script, I have an echo right after #!/bin/csh that never gets called, so the status variable never gets set. Running the command /media/dvd/bin/check_os ($media is /media/dvd in the above script) from the prompt works fine.
I've never seen this problem before, and it has worked on several machines previously. Anybody have a clue what is hosed up?
The issue I am having is that the main script isn't calling the embedded one. The call looks like this:
Code:
if (-e ${media}/bin/check_os) then echo "${media}/bin/check_os exists. Calling check_os" ${media}/bin/check_os echo "Outside check_os. Status is $(status)" if ($status == 1) then echo "check_os status = 1" goto fatal-fixable-exit
The variable media is defined correctly and the echo before the call looks good. Then, inside the check_os script, I have an echo right after #!/bin/csh that never gets called, so the status variable never gets set. Running the command /media/dvd/bin/check_os ($media is /media/dvd in the above script) from the prompt works fine.
I've never seen this problem before, and it has worked on several machines previously. Anybody have a clue what is hosed up?