exec in ksh

exec in ksh

am 22.11.2007 10:29:19 von patrick

Hi,
my script:

while read LINE
do
echo $LINE | awk '{FS=":"} {print $1" " $2" " $3}' | read DIR FILEN
OLD
EDIR=$(eval echo $DIR)
[ ! -d $EDIR -o ! -w $EDIR ] && continue
find $EDIR -type f -name "$FILEN" -mtime +$OLD -exec ls {} \;
find $EDIR -type f -name "$FILEN" -mtime +$OLD -exec rm -f {} \;
done < $SCRIPTS_DIR/etc/mftab

if i wont to change rm -f with cp -p where source is
the result of the find, how can i do?
thx

Re: exec in ksh

am 22.11.2007 20:29:26 von Barry Margolin

In article
,
Patrick wrote:

> Hi,
> my script:
>
> while read LINE
> do
> echo $LINE | awk '{FS=":"} {print $1" " $2" " $3}' | read DIR FILEN
> OLD
> EDIR=$(eval echo $DIR)
> [ ! -d $EDIR -o ! -w $EDIR ] && continue
> find $EDIR -type f -name "$FILEN" -mtime +$OLD -exec ls {} \;
> find $EDIR -type f -name "$FILEN" -mtime +$OLD -exec rm -f {} \;
> done < $SCRIPTS_DIR/etc/mftab
>
> if i wont to change rm -f with cp -p where source is
> the result of the find, how can i do?
> thx

find ... -exec cp -p {} dest \;

BTW, it would be nice if the Subject actually described the post? I see
no use of exec in your script. Your question is about find.

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***

Re: exec in ksh

am 22.11.2007 21:16:38 von gazelle

In article ,
Barry Margolin wrote:
....
>find ... -exec cp -p {} dest \;
>
>BTW, it would be nice if the Subject actually described the post? I see
>no use of exec in your script. Your question is about find.

'exec' as a find option.

Re: exec in ksh

am 23.11.2007 09:57:16 von patrick

On 22 Nov, 21:16, gaze...@xmission.xmission.com (Kenny McCormack)
wrote:
> In article ,
> Barry Margolin wrote:
> ...
>
> >find ... -exec cp -p {} dest \;
>
> >BTW, it would be nice if the Subject actually described the post? I see
> >no use of exec in your script. Your question is about find.
>
> 'exec' as a find option.

Thank you to all!!