shell script problem

I wrote a shell script, which invokes another shell script, and reporting the error of: (Unable to access node /proc) and I cannot figure out why. I wish someone here can help me to find out how to get it working.

The cutdown version of the scripts are:

if [ $1 == 1 ]
cmdStr="./ pidin -P pterm mem"
cmdStr="./ sin -P pterm mem"

$cmdStr &

for p in $*

while [ x -lt $# ]
cmd=$cmd" "${param[$x]}
echo cmd is : $cmd

op $cmd

It appears that when I passed it with a ‘sin’ command, it is not happy; but works find for a ‘pidin’ command.

Any help is greatly appreciated.


It seems the problem is the “&” after $cmdStr in… I don’t know why exactly… it’s like “sin” cmd try to search via the network (but locally) if it runs in background… try to make sin -n <non_existing_node> and you get the same error msg but at that remote node…

btw, why are makeing it a bit complex, calling cmd2 from cmd1 and transversing all the parameters, etc…?

Isn’t enough to execute just your sin or pidin cmd… ?


Hi Juanplacco,

Thank you to your response. As I mentioned in my original post, the is a cutdown version of a more complicated script. This script can take any command line or script as its input parameter and perform profiling function on the execution output of that input command line or script.

This error result of sin has been bothering me for a long time and I was using pidin instead to try get the statistical result. But recently, I have other application that desperately need that sin working.

I wonder if you or someone reading this can come up with a work around.


Do you still need to run cmd2 in background mode?

Good point. As you said, after I remove the &, it works magically. I guess I can live without running it in background mode at the moment.

The reason that I wanted to run it in background mode is I can use the same console to kill the script if necessary. But have it running is more important for me.