TARFILE=$(ls -1 /tmp/*.tar)According to http://partmaps.org/era/unix/award.html#ls you ought to replace the ls with a glob, e.g. like this:
[[ -s /tmp/*.tar ]] && set -A tarfiles /tmp/*.tarInstead you may want to enquire ${#tarfiles[@]}, i.e. the number of files globbed.
for TARFILE in "${tarfiles[@]}"
do
: # ...
done
Please forgive me the naming here! I was happy to take this note anyway.
No comments:
Post a Comment