Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rcmd (Remote Commands)

Status
Not open for further replies.
Feb 14, 2000
425
0
16
US
I am able to send remote commands from one host to another.<br>With that said on to my problem:<br>when remotly executing a command is there a file that controls the environment that the command will run under like .profile or /etc/profile .kshrc or something like that <p>Steve Bowman<br><a href=mailto:steve.bowman@wayservices.com>steve.bowman@wayservices.com</a><br><a href= > </a><br>
 
Might be worth prefixing the remote command with a &quot;-&quot;, as this may cause it to process /etc/profile and then $HOME/.profile before running the command.

I haven't tried it on rcmd, but I use it on local scripts.

Let me know if it worked !
 
hie,

to execute commands on the remote server with .profile environment try:

rcmd my_remote_host su - $LOGNAME <<EOF
command1
command2
....
commandx
EOF
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top