Hello,
Upon upgrading to suse11.2, I’ve noticed a reoccurring problem.
I use tcsh. When I execute by hand a command that is in my path…located in say “~/bin/myscript”…the command executes without an issue. I don’t need to use the absolute path “~/bin/myscript”, I can simply type the command “myscript” since the path “~/bin” is in my .tcshrc file.
When I execute the same command from a script, I get a “command not found” error. A similar issue is when I use the absolute command, but a library necessary the programs’ execution is defined within my .tcshrc file. I’ll get a library not found error.
I didn’t have this issue with earlier versions of suse.
Additional info that I just realized is relevant:
The system is a cluster with nodes nfs-mounting user directories from the server’s /home/ directory. I submit jobs via a ssh command such as " ssh mymachine myscript".
When I run "ssh mymachine ‘which ls’ " I get back the path “/bin/ls” like I should. If I run "ssh mymachine ‘which myscript’ ", I get a command not found error. If I run “which myscript” I get the correct path.
As mentioned, all machines use the same .tcshrc file because they all share the same nfs mounted directory.
I can not tell why it worked in 10.0 where it shoud not work also
For a solution look in that man page. Browse a bit, there are several places where adding something to a PATH is mentioned, but I do not think I should read them all where you can do this yourself. Also I do not use tcsh here for testing.
I created a wrapper script that explicitly defined the shell I needed. So instead of executing “ssh myscript”, I’d make a wrapper script “mywrapper” that has the shell information necessary for my target executable.
mywrapper:
#!/bin/tcsh
myscript
So my final execution is “ssh ~/pathtofile/mywrapper”
Still a mystery why this seemed unnecessary for previous releases.