![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| find and move | natasha80 | UNIX for Advanced & Expert Users | 7 | 11-04-2008 03:32 PM |
| edit results of a find command | grep_whoami | Shell Programming and Scripting | 6 | 10-15-2007 06:16 PM |
| How to sort find results | groundlevel | UNIX for Dummies Questions & Answers | 8 | 11-09-2005 02:36 AM |
| find results | Carmen123 | UNIX for Dummies Questions & Answers | 5 | 08-10-2005 10:27 AM |
| find move | saswerks | Shell Programming and Scripting | 4 | 02-24-2005 04:48 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
need to move find results
I am looking for files of a certian type and logging them. After they are logged they need to be moved to a different directory. HOw can i incorporate that in my current script?
CSV_OUTFILE="somefile.csv" find . -name W\* -exec printf "%s,%s,OK" {} `date '+%Y%m%d%H%M%S'` \; > ${CSV_OUTFILE} They would need to be moved from the current directory to one at the same level. For example: From ./name/inbox/file To ./name/archive/file |
|
||||
|
cp
Hi,
i am not quiet sure about your req. Suppose it is very close to follow: Hint: Find all the .txt file in current directory, record them in file.log file and then copy them to the parent directory. Hope you can finish it according to your exact requirements. code: Code:
for i in `find . -name \*.txt` do echo $i >> file.log cp $i ../ done |
|
||||
|
I guess I'd better clarify a bit.
Here is my current script, it formats the output of the find command: CSV_OUTFILE="somefile.csv" find . -name W\* -exec printf "%s,%s,OK" {} `date '+%Y%m%d%H%M%S'` \; > ${CSV_OUTFILE} Now, I need to modify this script to also use the output of the same find command as a list of files that need to be moved. The CSV file does not need to be moved, later in the script I FTP it to another server where the results are parsed and each time this script is run, it is overwritten anyway. Hope that explains it better. ![]() |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|