two consecutive statements in FTP script
Hi All,
I have made a shell script to copy and delete files through FTP. I want to first delete all txt files and then mput all txt files. Code:
ftp () If I remove "mdelete *.txt" line "mput" statement works well. Any idea, how to get through this ? |
Remember: "*.txt" has a script metacharacter in it :)
Try single-quoting the "mdelete" and "mput", and see if that helps: Code:
'mdelete *.txt' But to the extent I believe the problem is "metacharacters", I hope it'll at least point you in the right direction. 'Hope that helps .. PSM |
Quote:
I tried this, but I am getting the below error Quote:
|
OK - what about this:
Code:
mdelete '*.txt' Code:
mdelete "*.txt" |
Hi Paul,
I tried these too, no luck. :( |
what about using a for loop to avoid the metacharacters entirely? Though it's not a straight up ftp command, so you might have to work over your function a bit? We normally use scp/rsync/ssh etc for moving files around, makes things somewhat easier, but you might be stuck with ftp.
Something like this possibly (untested): Code:
for i in *.txt; |
Quote:
Thanks but I am looking for consecutive commands in ftp. |
All times are GMT -5. The time now is 03:52 PM. |