Hi everyone, Ive used the new SHH library to send commands to a unix server, and it works great for me. It perfectly conveys ordinary commands and returns the correct answers. However, I seem to encounter a problem 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 make this work.
On the unix server itself, the following commands work fine and do what they are intended to do:
- 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 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 it seems to me that something else is happening. I tried the following:
string command = string.Format("csh -c \"ls\"", arg1, arg2);` - WORKS
string command = string.Format("ls", arg1, arg2);` - WORKS
This seems to be due to the fact that Im trying to run a custom script, or maybe some kind of dumb setup that I forgot. Let me know if you need more details.
EDIT: DOES NOT WORK, I mean that the result returned in C # should say some things, but the result is empty. In addition, the script sends a TIBCO Rendevous message, which ultimately adds a record to the database that is not displayed. When I say WORKS, I mean that the record appears in the database.