what does the below command will do
ls "$ftp_ldir" | grep "$ftp_file"
By itself, nothing. If you define the variables it will search the directory $ftp_ldir for filenames containing the string $ftp_file.
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"
fiftp -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
ftpend1if [ "$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
ftpend2fi
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
ftpend3fi
echo "FTP Operation Complete " >> "$script_output_file"
Yes (14) | ![]() | |
No (14) | ![]() | |
I don't know (15) | ![]() |