Results 1 to 5 of 5
Hi,
I'm having trouble getting a script to work. If I enter the following on the command line: (Note: I've had to replace the "at" character to get this post ...
- 01-07-2011 #1Just Joined!
- Join Date
- Jan 2011
- Posts
- 2
having trouble getting a script to work
Hi,
I'm having trouble getting a script to work. If I enter the following on the command line: (Note: I've had to replace the "at" character to get this post onto the forum).
... and then enter my password manually, it works fine and the sshfs volume mounts to my desktop. I then tried to write a script so I don't need to type my password in:Code:/Applications/sshfs/bin/mount_sshfs user*at*192.168.0.1: /Users/me/sshfs/harddisk
I've saved this to a file called go.sh. If I launch ./go.sh from the same command prompt as above, it executes without causing any errors, but the volume doesn't mount.Code:#!/usr/bin/expect spawn /Applications/sshfs/bin/mount_sshfs user*at*192.168.0.1: /Users/me/sshfs/harddisk expect "*?assword:" send "1234\r" expect eof exit 0
Any clues?
- 01-07-2011 #2Just Joined!
- Join Date
- Oct 2008
- Posts
- 44
I'm no expert, but I don't know what the "spawn" command is. I don't seem to be able to find it here. Have you tried the script without it?
- 01-07-2011 #3Linux Engineer
- Join Date
- Apr 2006
- Location
- Saint Paul, MN, USA / CentOS, Debian, Solaris, SuSE
- Posts
- 1,117
Hi, GMorris.
This appears to be an expect script, not a shell script ... cheers, drl
Code:spawn [args] program [args] creates a new process running program args. Its stdin, stdout and stderr are connected to Expect, so that they may be read and written by other Expect commands. The connection is broken by close or if the process itself closes any of the file identifiers. -- excerpt from man expect, q.v.Welcome - get the most out of the forum by reading forum basics and guidelines: click here.
90% of questions can be answered by using man pages, Quick Search, Advanced Search, Google search, Wikipedia.
We look forward to helping you with the challenge of the other 10%.
( Mn, 2.6.n, AMD-64 3000+, ASUS A8V Deluxe, 1 GB, SATA + IDE, Matrox G400 AGP )
- 01-07-2011 #4Just Joined!
- Join Date
- Oct 2008
- Posts
- 44
- 01-12-2011 #5Just Joined!
- Join Date
- Jan 2011
- Posts
- 2
Found an easier way:
Code:echo password | sshfs etc. -o password_stdin
Hope this helps someone!


Reply With Quote
