![]() |
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 |
| grep -A switch not working correctly with -m | zer0 | UNIX for Dummies Questions & Answers | 2 | 06-19-2008 06:26 AM |
| Shell Implementation not working correctly | AirBronto | High Level Programming | 14 | 02-15-2008 10:41 PM |
| Variable not working correctly. | walsh_j | Shell Programming and Scripting | 3 | 05-30-2007 02:50 PM |
| if not working correctly | 2dumb | Shell Programming and Scripting | 3 | 05-03-2007 02:38 PM |
| Script not working correctly | elchalateco | UNIX for Dummies Questions & Answers | 2 | 10-11-2002 04:09 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Find cmd not working correctly in script
I am trying to copy 2 types of files so I can archive them. I tested with a set of commands:
touch -t $(date -d "-60 day" +%Y%m%d) WORKDIR/REF find TARGETDIR/ -type f -maxdepth 1 -iname \*.out\* -or -iname \*.log\* ! -newer WORKDIR/REF -exec ls -l {} \; This correctly lists any files in the directory over 60 days old with .log or .out in the name. But when I execute this in a ksh script, I only get whichever string I have listed last, in this case I only get the .log files. Switching log and out, I only get the .out files. I can do this with 2 separate find commands, but I was wondering why it won't work as a single comd in the ksh script? |
|
||||
|
Quote:
Code:
-or -iname Last edited by glen.barber; 09-29-2008 at 05:07 PM.. Reason: Fixed typo |
|
||||
|
But the directories that I am searching, have both names in them and the find command finds them both flawlessly when I run it from the command line prompt. It is only in the ksh script that it seems to take only the last search string.
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|