Re: Sheell Script for SFTP

From: Ian East (ian.east_at_gmail)
Date: 09/08/05


Date: Wed, 07 Sep 2005 16:31:17 -0700

On Mon, 5 Sep 2005 17:51:47 +0530, "Venkat" <khvenkat@cisco.com>
wrote:

>
>> This is what i tried but when i execute ./prg1.sh it hangs
>>
>> #!/bin/sh
>> HOST='10.77.31.202'
>> USER='root'
>> PASSWD='venkat'
>>
>> ftp -n ${HOST} << EOF
>> user {$USER} ${PASSWD}
>> cd /root
>> get test
>> exit 0
>> EOF
>
>Hi Ian,
>
>FTP may be disabled can we the same functionality like transferring the
>files without prompting for a password using either sftp or scp?
>If so what else needs to be modified in the above to acheive it.
>
>Regards,
>Venkat
>

Check your syntax...

host1:~$ TEST='asdf'; echo {$TEST}
{asdf}
host1:~$ TEST='asdf'; echo ${TEST}
asdf



Relevant Pages

  • Re: Need some help with string manipulation
    ... > And assing the remaining string (i.e host1) alone to a variable. ... > Could some one throw in a quick awk script and help me? ... $ echo $ ... the korn shell, and probably others will do the same. ...
    (comp.unix.admin)
  • Parsing and Matching <NEWB>
    ... I've created a shell solution for this, but believe perl could do this ... Is there a way to store the output of system calls in scalars? ... $asdf = system (echo hello); ... print $asdf; #should print "hello"; ...
    (comp.lang.perl.misc)