1753487 Members
4668 Online
108794 Solutions
New Discussion юеВ

Re: echo

 
Fuad_1
Regular Advisor

echo

Hi all,

echo "\$send_file_list" | ftp -i xyz

What the above script line is doing, and where I can get the send_file_list?

Thanks.
Set goals, and work to achieve them
6 REPLIES 6
James R. Ferguson
Acclaimed Contributor

Re: echo

Hi:

The echo statement is writing to STDOUT the exact string shown and then passing (piping) that to the 'ftp' process which is going to open an interactive ftp session with host "xyz".

The backslash in front of the '$' escapes tells your shell *not* to interpolate the string as a variable but leave it alone.

Regards!

...JRF...
Fuad_1
Regular Advisor

Re: echo

Thanks James,

But where I can see the value of send_file_list?
Set goals, and work to achieve them
Oviwan
Honored Contributor

Re: echo

there is no value for send_file_list. try it in a shell:
# echo "\$send_file_list"
$send_file_list

is this a line in a script?
Fuad_1
Regular Advisor

Re: echo

Yes, this suppose to transfer file from one server to another!
Set goals, and work to achieve them
James R. Ferguson
Acclaimed Contributor

Re: echo

Hi (again) Fuad:

> But where I can see the value of send_file_list?

There is no value. The backslash ('\') tells the shell *not* to evaluate the '$send_file_list'. Compare these:

# send_file_list=somefiles
# echo "$send_file_list"
somefiles
# echo "\$esnd_file_list"
$send_file_list

Regards!

...JRF...
James R. Ferguson
Acclaimed Contributor

Re: echo

Hi (again) Fuad:

> Yes, this suppose to transfer file from one server to another!

Then you undoubedly want to drop the '\' from "\$send_file_list".

Regards!

...JRF...