No matter what I tried I was getting "no such device" errors, in the end I figured it was down to the file descriptors (i.e. stdin/out/err).
So if you want to execute a windows command/batch file (via CMD.exe) via Interix RSH daemon:-
(unix land)
$ rsh"runwin32 <windows style path to exe/bat> </dev/null | cat"
e.g.
$ rsh x0 "runwin32 e:\wrcheck\wrcheck.bat </dev/null | cat"
What this does is re-direct stdout/stderr via the pipe so you see the output via cat, stdin is redirected from /dev/null, obviously this can be changed to suit your individual needs.
You could of course also redirect stdout/err seperately via >stdout.txt 2>stderr.txt.
I hope this saves someone a headache :)
No comments:
Post a Comment