Solved can you please explain what does the command will do

August 17, 2012 at 04:54:11
Specs: Windows XP
what does the below command will do
ls "$ftp_ldir" | grep "$ftp_file"

See More: can you please explain what does the command will do

Report •

#1
August 17, 2012 at 04:58:13
✔ Best Answer
By itself, nothing. If you define the variables it will search the directory $ftp_ldir for filenames containing the string $ftp_file.

Report •

#2
August 17, 2012 at 05:13:14
Hi,
Thank you
and can you please explian the below also.If i wont give the third part that is (if [ "$ftp_DBvar1" -eq "fci" ]; then)it is creating one file in local directory by condition 1.but if i give the 3rd condition it is creating an other file with the file name "ftp_file" which we are ftping, along with the file "ftp_lfile" in local directory .this ftp_file is having list of all files of remote server path from where we are ftping the file.
Is there anything wrong in the code ?

echo [`date`] Starting FTP from "$ftp_host" server >> "$script_output_file"
echo "$ftp_file" | grep "*"
if [ $? -ne 0 ]
then
ftp_getcmd="get"
else
ftp_getcmd="mget"
fi

ftp -i -n -v <<-ftpend1
open "$ftp_host"
user "$ftp_user" "$ftp_pass"
"$ftp_mode"
lcd "$ftp_ldir"
cd "$ftp_rdir"
"$ftp_getcmd" "$ftp_file" "$ftp_lfile"
quit
ftpend1

if [ "$ftp_rarc_required" = "Yes" ]; then

ftp -i -n -v <<-ftpend2
open "$ftp_host"
user "$ftp_user" "$ftp_pass"
"$ftp_mode"
lcd "$ftp_ldir"
cd "$ftp_rdir"
#ls -l $ftp_file
#if [ $? -eq 0 ]
#then
#mv "$ftp_file" "$ftp_rfile"
mdelete "$ftp_file"
cd "$ftp_rarc_dir"
mput "$ftp_file"
quit
ftpend2

fi

if [ "$ftp_DBvar1" -eq "fci" ]; then

ftp -i -n -v <<-ftpend3
open "$ftp_host"
user "$ftp_user" "$ftp_pass"
"$ftp_mode"
cd "$ftp_rdir"
ls -l "$ftp_file"
if [ $? -eq 0 ]
then
#if [ "$ftp_file" ]; then
zip "ftp_rfile" $ftp_file
rm -f $ftp_file
fi
quit
ftpend3

fi

echo "FTP Operation Complete " >> "$script_output_file"


Report •
Related Solutions


Ask Question