find and FTP multiple files in Korn Shell


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers find and FTP multiple files in Korn Shell
# 1  
Old 08-13-2007
find and FTP multiple files in Korn Shell

I want to FTP multiple files in a directory that the files were created since midnight of the same day using korn shell. I can use the "find" command using -newer arguement that compares against a time stamp file. The script identifies the files, I can't use a variable = `find . ` as the variable will only identify the first file it finds and echo a ./filename and FTP only that file. I need to be able to FTP multiple files Is there another way to get multiple files to do an action such as FTP?
# 2  
Old 08-13-2007
I have answered my question by doing a "for" "in" "do" process.
# 3  
Old 08-13-2007
Let ..... mean your extra criteria

Code:
find . -type file ....

will list only files, so assuming you have your .netrc setup.....

Code:
find . -type file ..... | while read N
do
      echo "put $N" | ftp remote-host
done

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

shell script to ftp multiple files

Hi, i use the below script to send a single file to remote server from linux. ftp -nvi <<!EOF open $Host_name user $USER_ID $PWD binary mput $file_name quit !EOF (where i... (2 Replies)
Discussion started by: pradebban
2 Replies

2. Shell Programming and Scripting

Korn Shell programming (FTP, LOOPS, GREP)

Hello All, I have another Korn shell question. I am writing a script that will ftp a file from my production database to my test database. To this, I have to construct a loop that checks a specified folder for a file. If the file exists, I want it execute the ftp protocol and then exit. ... (2 Replies)
Discussion started by: jonesdk5
2 Replies

3. Shell Programming and Scripting

Find command in Korn Shell

Hi, I am trying to execute the below in Ksh (telnet) find ./request.txt -mmin -30 It says find: bad option -mmin What i am trying to do is by using find command i am checking wheather the file request.txt is there for 30 minutes or not Please help (1 Reply)
Discussion started by: chinniforu2003
1 Replies

4. Shell Programming and Scripting

shell script to find and replace string in multiple files

I used the following script cd pathname for y in `ls *`; do sed "s/ABCD/DCBA/g" $y > temp; mv temp $y; done and it worked fine for finding and replacing strings with names etc. in all files of the given path. I'm trying to replace a string which consists of path (location of file) ... (11 Replies)
Discussion started by: pharos467
11 Replies

5. AIX

how to check the existence of a file during ftp using korn shell?

i can able to transfer a file from build server(AIX)to webserver using ksh through ftp.my query is to check the existence of file while transfering from one server to other .i.e i need some command or script that checks the existence of file with same name in both server,within ftp syntax. ... (1 Reply)
Discussion started by: karthikprasathk
1 Replies

6. Shell Programming and Scripting

Korn Shell Script to find out error in logfile

Hi All, I am new to this forum as well as to unix scripting. Can you please help me to create a korn shell script to find out errors in logfiles and get the name of that logfile ( which is having error) in email and email it to me? (2 Replies)
Discussion started by: jithu
2 Replies

7. Shell Programming and Scripting

Find and Replace in multiple files (Shell script)

hi guys, Suppose you have 100 files in a folder and you want to replace all occurances of a word say "ABCD" in those files with "DCBA", how would you do it ??? jatin (13 Replies)
Discussion started by: jatins_s
13 Replies

8. Shell Programming and Scripting

How to process multiple files in Korn Shell

How do I make the below ksh to process all of the files inside a user specified directory? Currently it can only process one file at a time. #!/bin/ksh tr -s '\11 ' ' ' < $1 > temp0 sed -e 's/,//g' temp0 > temp1 cut -d' ' -f1,4,5 temp1 > final_output rm temp0 temp1 (3 Replies)
Discussion started by: stevefox
3 Replies

9. Shell Programming and Scripting

Multiple su - in Korn Shell script

i am trying to do something like this : #!/bin/ksh # Change to the userid user1 su - user1 #Issue the command to change directory and list files cd /home/user1/ ls -lrt exit #Come out of the user1 to root again #change to user 2 su - user2 cd /home/user2/ ls -lrt... (2 Replies)
Discussion started by: furrari
2 Replies

10. Shell Programming and Scripting

Need quick help with basic FIND in korn shell

I gotta make a script to find files, not quite sure whats wrong... filename is search i run it search ass* $HOME ass* is the filename and in my script i have... find $2 -name $1 -print but it never works, anyone know what i gotta fix? and does anyone know the difference... (6 Replies)
Discussion started by: Freakytah
6 Replies
Login or Register to Ask a Question