![]() |
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 |
| Whats wrong in the script? | nehagupta2008 | UNIX for Dummies Questions & Answers | 1 | 06-02-2008 06:24 AM |
| tell me whats wrong with this | nadman123 | Shell Programming and Scripting | 1 | 04-14-2008 11:58 PM |
| Whats wrong in this Script ??? | varungupta | UNIX for Advanced & Expert Users | 4 | 08-31-2007 04:02 AM |
| Whats wrong with this 5 line script! | c19h28O2 | Shell Programming and Scripting | 9 | 05-11-2006 01:04 AM |
| whats wrong with this awk??? | george_ | Shell Programming and Scripting | 5 | 04-04-2006 04:58 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Whats wrong with this script?
Hi all,
Code:
#!/bin/ksh
BIN=/interface/Gunner
age=$1
directory="$2"
[ "$directory" = "" ] && directory=.
cd "$directory" || exit 1
from=`$BIN/today -$age`
cd $BIN
for i in `cat filestoarchive.txt`;do
cd $i
find . -mtime 14 | grep -v '.tar$' | $BIN/dttmfilter | awk '$1<="'$from'"{ print;};' | \
done
while read d t f
do
[ -d $f ] && continue
opt=u
[ -w $d.tar ] || opt=c
tar ${opt}f $d.tar $f && touch -r $f $d.tar && rm -f $f
done
Is it wrong to have two while statements?The first while statement grabs the files that were modified 14days ago... Thanks |
|
||||
|
followup
I have for there instead of the while. Now I fixed it. The find . -mtime should come after done NOT before.
|
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|