afternoon all,
with help from p5wizard, earlier, i almost have a script finished but am having an issue with some 'or' phrasing.
code as follows:
what i need to do is execute the echo if $base.b is not in dira or dirb
i have tried th -o for 'or' as posted above also || but when $base.b does not exist in dira but does exist in dirb i still get the output into dsnodotb.txt.
any suggestions?
regards,
longhair
with help from p5wizard, earlier, i almost have a script finished but am having an issue with some 'or' phrasing.
code as follows:
Code:
cd /dira
rm dsnodotb.txt
rm dsinscrpt.txt
for file in $(ls *.a 2>/dev/null)
do
base=$(basename $file .a)
if [ ! -f /dira/$base.b ] -o [ ! -f /dirb/$base.b ]
then
echo $file: $base.b does not exist >> dsnodotb.txt
fi
done
cat /dira/dsnodotp.txt | while read dotr dotb tmp
do
find /dirc -type f -print |xargs grep $dotb >> /dirb/dsinscrpt.txt
done
i have tried th -o for 'or' as posted above also || but when $base.b does not exist in dira but does exist in dirb i still get the output into dsnodotb.txt.
any suggestions?
regards,
longhair