Hi
i have filenames in the following file test.txt
abc_0000
abc_0030
abc_0100
xyz_000
xyz_0030
xyz_0100
my_own_test
in my directory /tmp
How do I write a unix script that reads each
of these names in the listing test.txt
and only process files whose names ends with
0000, 0030, 0100, ....every 30 interval
and at the same time, disregard
my_own_test listing ?
Appreciate any help.
I tried
while read my_file; do
if [ ${my_file##*_} != [0-9] ]
then
echo "Not correct file!"
else
echo "correct file $my_file..."
fi
done < test.txt
i have filenames in the following file test.txt
abc_0000
abc_0030
abc_0100
xyz_000
xyz_0030
xyz_0100
my_own_test
in my directory /tmp
How do I write a unix script that reads each
of these names in the listing test.txt
and only process files whose names ends with
0000, 0030, 0100, ....every 30 interval
and at the same time, disregard
my_own_test listing ?
Appreciate any help.
I tried
while read my_file; do
if [ ${my_file##*_} != [0-9] ]
then
echo "Not correct file!"
else
echo "correct file $my_file..."
fi
done < test.txt