4

I want to put two commands together

I need the script to login:

ssh [email protected]

Then I need to the script to run (while logged in to [email protected] via ssh ):

find /var/mobile/Media/Music/ -name "*.mp3" -exec ln -s {} /var/mobile/Media/Music/"All Songs" \;

2 Answers 2

5

You can include a command to run on the remote machine as the last argument to ssh

ssh [email protected] 'find /var/mobile/Media/Music/ [...]'
1
  • Worked perfectly!!
    – era878
    Mar 20, 2011 at 20:16
0

You can try:

sshpass -p YOUR_PASS_HERE ssh [email protected] find /var/mobile/Media/Music/ -name "*.mp3" -exec ln -s {} /var/mobile/Media/Music/"All Songs" \;

Cheers, André Gondim http://andregondim.eti.br

1
  • Providing password on the command line is not very secure. It's much better to use the public key authentication in such cases. Mar 21, 2011 at 15:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .