[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

RE: Find and copy script/piped command



bdegan ticnet com wrote

>You could do:
>
>find /tmp  -mtime -1 -exec bkup.sh {}   \;
>
>and then the bkup.sh script could do something like:
>
>
>if [ -f $1 ] ; then
>  file=`echo $1 | awk '{n=split($0,AR, "/");print AR[n] }'`
>  cp -v $1 /tmp/backup/$file
>fi

You could use the basename command here.

Lawrence




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]