exec in ksh

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 <source> <dest> where source is
the result of the find, how can i do?
thx
patrick [ Do, 22 November 2007 10:29 ] [ ID #1876348 ]

Re: exec in ksh

In article
<f3be643c-0259-4dc3-9d2f-2b4092fdf2c0 [at] g21g2000hsh.googlegroups.com>,
Patrick <patrick.moresi [at] gmail.com> 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 <source> <dest> 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 [at] 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 ***
Barry Margolin [ Do, 22 November 2007 20:29 ] [ ID #1876357 ]

Re: exec in ksh

In article <barmar-425BAA.14292622112007 [at] comcast.dca.giganews.com>,
Barry Margolin <barmar [at] alum.mit.edu> 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.
gazelle [ Do, 22 November 2007 21:16 ] [ ID #1876360 ]

Re: exec in ksh

On 22 Nov, 21:16, gaze... [at] xmission.xmission.com (Kenny McCormack)
wrote:
> In article <barmar-425BAA.14292622112... [at] comcast.dca.giganews.com>,
> Barry Margolin <bar... [at] alum.mit.edu> 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!!
patrick [ Fr, 23 November 2007 09:57 ] [ ID #1876979 ]
Linux » comp.unix.shell » exec in ksh

Vorheriges Thema: fcitx zombie process
Nächstes Thema: sql statement in a here document - 2nd try