cd after ssh
Hi all,
sorry if this question has been answered numerous times before, I can't seem to find an answer anywhere. I have created a bash script here that should ssh into a server, cd to a directory and scp certain files into another server. For some reason, after I ssh into the server (we have keys installed so don't need the passwords) it just sits there. I try to pwd after the ssh but nothing happens, it just sits there after the ssh like it's waiting for me to do something. Is there some additional step I'm missing? I can't seem to find anything on the net that states otherwise. Thanks. |
Can you post your script, please?
|
Sorry I guess that would help:
#!/bin/sh path='/path/to/go/to' ssh name@server cd $path scp blah blah . . The problem is once it gets onto the server it just stops there. I threw a pwd after the ssh to verify but it doesn't do that either. I'm sure it's a simple fix I'm just having problems locating an answer. Thanks. |
Quote:
Did you think the script was transferred to the remote server and executed its remaining lines there? Try this example: Code:
echo "line 1: located at `hostname`" |
Why dont you use the following:
Code:
remote_path=/remote/path/ |
Ah that makes sense, ha! :/
I have it working now, thanks guys! |
All times are GMT -5. The time now is 02:36 PM. |