hi, this could be simple one.
I have one file which contains variables like..
Code:
...
files=( /root/b/*.txt /root/xyz.txt)
..
now I have script which reads above file.
Code:
....
if [[ "${#files[@]}" != 0 ]]
then
for i in "${files[@]}"; do echo $i; done
else
echo "not correct"
fi
....
suppose
/root/b folder has 5 .txt files than array "files" gets 5 + 1(xyz.txt)=6 values.
what i want as out put is:
same what is written there (with * character) that means array should have just 2 elements like:
Code:
/root/b/*.txt
/root/xyz.txt
So * should be there and should not get expanded.
Thanks, Ajay