| | |
unzip, date, etc not available from scripts
![]() |
•
•
Join Date: Jul 2008
Posts: 11
Reputation:
Solved Threads: 0
Hello,
I am a newbie and do not have any shell script experience. I am trying to call a script from inside a fortran call using the call system(./script).
Now this script runs ok when run from command line, but when called from the fortran call, i get errors for unzip, date etc. i.e these commands cannot be found.
Do I need to do something additional to get these commands to run ? I need to unzip a few files inside the script, hence its necessary that this works from the system call.
Thanks,
Nikhil
I am a newbie and do not have any shell script experience. I am trying to call a script from inside a fortran call using the call system(./script).
Now this script runs ok when run from command line, but when called from the fortran call, i get errors for unzip, date etc. i.e these commands cannot be found.
Do I need to do something additional to get these commands to run ? I need to unzip a few files inside the script, hence its necessary that this works from the system call.
Thanks,
Nikhil
They don't have a full environment. Set the environment variables you need (such as PATH) in the script.
Java Programmer and Sun Systems Administrator
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
•
•
Join Date: Jul 2008
Posts: 11
Reputation:
Solved Threads: 0
I tried both suggestions but it does not seem to work. Any idea what is happening? it works when I run the script from command line.
./init.VTd.nik: ./init.VTd.nik: 18: which: not found
./init.VTd.nik: ./init.VTd.nik: 20: /usr/bin/unzip: not found
./init.VTd.nik: ./init.VTd.nik: 47: make: not found
/u0/n/nikhill/alina/./Main_new: /u0/n/nikhill/alina/./Main_new: 176: date: not found
I am calling a script called Main_new which inturn calls the script init.VTd.nik and I seem to have this problem in both the scripts.
Please suggest something.
Thanks,
Nikhil
./init.VTd.nik: ./init.VTd.nik: 18: which: not found
./init.VTd.nik: ./init.VTd.nik: 20: /usr/bin/unzip: not found
./init.VTd.nik: ./init.VTd.nik: 47: make: not found
/u0/n/nikhill/alina/./Main_new: /u0/n/nikhill/alina/./Main_new: 176: date: not found
I am calling a script called Main_new which inturn calls the script init.VTd.nik and I seem to have this problem in both the scripts.
Please suggest something.
Thanks,
Nikhil
That is not the full path to the command. I can guarantee that "." is not what you think it is. Use the full path whether setting the Path or using the full path in the command.
Java Programmer and Sun Systems Administrator
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
•
•
Join Date: Jul 2008
Posts: 11
Reputation:
Solved Threads: 0
Hello,
this is how I am making the call from the fortran routine:
Previously I was doing it this was:
The script does run but i have the same problems. Also inside the Main_new script, I call the other script as :
, again with same problems. The script does run and the cp and mv commands also work, but make, date etc do not run even with PATH or giving direct path as:
this is how I am making the call from the fortran routine:
Shell Scripting Syntax (Toggle Plain Text)
CALL system("$HOME/alina/Main_new")
Previously I was doing it this was:
Shell Scripting Syntax (Toggle Plain Text)
CALL system("$HOME/alina/./Main_new")
The script does run but i have the same problems. Also inside the Main_new script, I call the other script as :
Shell Scripting Syntax (Toggle Plain Text)
/${HOME}/alina/run_VT/init.VTd.nik
Shell Scripting Syntax (Toggle Plain Text)
/usr/bin/date
Last edited by nikhil.laghave; Mar 19th, 2009 at 5:41 pm.
Please describe "does not run".
Java Programmer and Sun Systems Administrator
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
![]() |
Similar Threads
- Help with automatic update problem and more (Viruses, Spyware and other Nasties)
- Help needed in this script (Shell Scripting)
Other Threads in the Shell Scripting Forum
- Previous Thread: problem with sudo and test
- Next Thread: A simple bash script not working as expected
Views: 757 | Replies: 7
| Thread Tools | Search this Thread |
Tag cloud for Shell Scripting






