Hi I have the following script:
grep -iH csunix $1
sed 's#/home/csunix/menig/LOCAL_PARTITION/#/usr/not-backed-up/////////////////#g' $1 > $1.tmp && mv $1.tmp $1
echo "Replaced LOCAL_PARTITION"
sed 's#/home/csunix/menig/#/usr/not-backed-up/#g' $1 > $1.tmp && mv $1.tmp $1
echo "Replaced menig"
grep -i csunix $1
1. I would like the files to be passed to sed to be the output of grep... rather than passing one by one from the command line...
2. How can I preserve the file permissions which are getting lost...