Dear experts,
In a directory i have both *.TXT and *.txt files. I have a script-
for file in `ls *.txt`; do
mv $file /tmp/$file
How to list both .txt and.TXT file in one command so that script will move both .txt or .TXT whatever it find.
br//purple
for file_name in *.[tTxXtT]*
do
echo "$file_name"
done
ls is not needed here
well now how i will put the $file_name in my script--
for file in `ls *.[tTxXtT]*`; do
mv $file /tmp/$file
please note that in my file i have *.txt.log. i must omit the .txt.log files. Only takes that ended with .txt or .TXT
Tytalus
5
for file_name in *.txt *.TXT
do
echo "$file_name"
done
should work fine