
May 11th, 2012, 10:11 AM
|
|
|
It's a horrible way of doing it, are all the things in that file the same format? If so there's are far nicer ways of doing this. You seem to have two related lines for each item, and use those to determine if that item (a file name) exists. If all you had was the filename then all you'd need to do woudl be to loop over the contents and have the actual commands explicitly in your script:
Code:
for file in $(grep -v "^#" /path/to/config.file)
do
if [ -f $file ]
then
echo "exists"
else
echo "not exists"
fi
done
__________________
The moon on the one hand, the dawn on the other:
The moon is my sister, the dawn is my brother.
The moon on my left and the dawn on my right.
My brother, good morning: my sister, good night.
-- Hilaire Belloc
|