How to grep and pipe to mput ftp


 
Thread Tools Search this Thread
Special Forums UNIX Desktop Questions & Answers How to grep and pipe to mput ftp
# 1  
Old 01-22-2010
How to grep and pipe to mput ftp

I am ptting the following into an FTOP script.
date=`TZ="aaa24" date +'%Y%m%d'` # this gets Yesterday date

.
.
.
.

mput < 'l | grep $Vdate'

# the idea to grep a listing from a directory that has yesterday date in its file name then put it in the remote FTP server. How can I get it to work
# 2  
Old 01-22-2010
play around with this. Also note: it is a really bad idea to create and use variable names
in a shell script that are the same as a command like date.

Code:
mydate=`TZ="aaa24" date +'%Y%m%d'`
echo "
open remote_node
USER username passwd
mput *${mydate}*
bye
 " | ftp -n -i

# 3  
Old 01-24-2010
FTP

Jim
Thanks but that will upload all $Vdate not only yesterday, my proplem is that the date is located in the middel of the file name between the store number and other txtSmilie
# 4  
Old 01-24-2010
Try it without the braces:

Code:
mput *$mydate*

# 5  
Old 01-25-2010
oo, thank you!!

______________________

Last edited by vbe; 01-25-2010 at 09:31 AM.. Reason: No foreign language please (nor unwanted URL)
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Using pipe in FTP session

Hi All , I want to use pipe in ftp session . Please let me know if there is any possibility I have done FTP to a remote host with proper username and password Now I want to take the latest file in a directory . The below is not workinf ftp> ls -lrt |... (4 Replies)
Discussion started by: Sandeep Lade
4 Replies

2. UNIX for Dummies Questions & Answers

How To Pipe Find To Grep?

hi what wrong with my syntax here? find / -name "*dhcp*" | grep -l -r 'timeout' thanks (3 Replies)
Discussion started by: johnywhy
3 Replies

3. UNIX for Dummies Questions & Answers

Bash - CLI - grep - Passing result to grep through pipe

Hello. I want to get all modules which are loaded and which name are exactly 2 characters long and not more than 2 characters and begin with "nv" lsmod | (e)grep '^nv???????????? I want to get all modules which are loaded and which name begin with "nv" and are 2 to 7 characters long ... (1 Reply)
Discussion started by: jcdole
1 Replies

4. UNIX for Dummies Questions & Answers

Pipe grep to rm

We have a number of OS X 10.6 machines who have home folders with incorrect permissions, which are causing managed prefs not to be applied correctly and not allowing saving. I need to delete all home folders whose name is numerical and modified before a certain date. I'm not sure of the date part... (2 Replies)
Discussion started by: airlocksniffer
2 Replies

5. Shell Programming and Scripting

problem using a pipe to grep

Hello ! I want to process a text file in order to extract desired data using sed and grep... Now I am facing a problem piping to grep... nothing happens.. The text consists of blocks of 3 lines that may (or not) contain the Desired data. the desired data is on each 2... (4 Replies)
Discussion started by: ShellBeginner
4 Replies

6. Shell Programming and Scripting

broken pipe for ftp file transfer

hi i am trying to connect to a remote server and trying to uploa a file. during upload i am getting ":Broken pipe" error please help (0 Replies)
Discussion started by: Satyak
0 Replies

7. AIX

How to ftp a pipe file

ftp> put 75384.DT.pipe 75384.DT.pipe: not a plain file. ls -l 75384.DT.pipe prwxrwxrwx 1 aaa staff 308 Apr 01 12:26 75384.DT.pipe How to transfer this file to other machine? (3 Replies)
Discussion started by: rainbow_bean
3 Replies

8. Shell Programming and Scripting

mput is not working in ftp script

1)In this script mput command is not working( not transfering multiple files, it is able to send single file) 2)here is the script to automate the ftp process . 3)for transfering files from one machine to other machine using ftp can anyone can give me the solution in this issue Script is... (6 Replies)
Discussion started by: gsri
6 Replies

9. Solaris

FTP limits - mput *

I am trying to upload via FTP 11,000 files in a Solaris 8 system. I am using Windows 2000 and its FTP client to upload the files. The command used is mput *.jpg.When the quantity of files reaches 10,000 the upload aborts. Is this problem related with the FTP client ? If yes, another FTP client... (2 Replies)
Discussion started by: waldecy
2 Replies

10. UNIX for Dummies Questions & Answers

Pipe out ftp command to a file

hi there all the unix-gurus, anyone can offer me some advise/help? i'm writing a ftp script and i need to spool out the output to a file but i'm facing some problems when i'm doing the following: ftp -n <mail server> ${log_dir}/test_put.log << END user <user_id> <password> verbose bin #... (2 Replies)
Discussion started by: lweegp
2 Replies
Login or Register to Ask a Question