Hey all, Ive been using a new SHH library to send commands to a unix server and its been working great for me. It sends normal commands just fine and recives the proper responses. However, I seem to be running into an issue when I try to use it to run a custom script (not a shell script, but a file that contains another command and has arguments)
Ive tried several ways to get this to work.
On the unix server itself the following commands work perfectly and do what they are intended:
- cd script; script.oi someArg someArg - WORKS
- csh -c "cd script; script.oi someArg someArg" - ALSO WORKS
- cd /users/bin/script; script.oi someArg1 someArg 2 - WORKS
- csh -c "cd /users/bin/script; script.oi someArg1 someArg 2" - WORKS
- /users/bin/script/script.oi someArg1 someArg2 - WORKS
However, in the code I have tried the following:
string command = string.Format("csh -c \"cd script; script.oi {0} {1}\"", arg1, arg2); - DOES NOT WORK
string command = string.Format("cd script; script.oi {0} {1}", arg1, arg2); - DOES NOT WORK
string command = string.Format("cd /users/bin/script; script.oi {0} {1}", arg1, arg2); - DOES NOT WORK
string command = string.Format("csh -c \"cd /users/bin/script; script.oi {0} {1}\"", arg1, arg2); - DOES NOT WORK
string command = string.Format("/users/bin/script/script.oi {0} {1}", arg1, arg2); - DOES NOT WORK
So to me it seems like something else is going on. I did try the following:
string command = string.Format("csh -c \"ls\"", arg1, arg2);` - WORKS
string command = string.Format("ls", arg1, arg2);` - WORKS
It looks like it has to do with the fact that Im trying to run a custom script, or maybe some silly setting I've forgotten. Let me know if you need anymore details.
EDIT: By DOES NOT WORK, I mean that the result that is returned to the C# is supposed to say some stuff, but the result is blank. Additionaly, the script sends a TIBCO Rendevous message which eventually adds an entry to a DB, which is not showing up. When I say WORKS, I mean that the entry is showing up in the DB.
script.oi. What doesls -al /users/bin/script/script.oioutput?-rwx--x--xarg1andarg2? And which user do you use to login?