I am trying to run a script in AIX to execute another script on a remote server. In addition to the remote script i need to send the stdout to /dev/null. The same command works fine on another server but when I run on the current server it hangs, any advice?
su - test -c "rsh testserver /scripts/testme" 2>&1 >/dev/null1
In your comment you write that a menu is presented when the user logins.
Let's say this is done in the .profile file, using echoes and a read command.
When a menu is presented, the
readcommand in the menu code will not be skipped by redirecting the output. The menu still waits for your input and the su command seems to hang.Can you change your
.profileor.bashrcso that it will skip presenting the menu when called using a su command? When this is called during startup, you can look at the returncode oftty. When you use the su command from the commandline, you should look for another solution. When your root shell is ksh, you can try the following: