Hello,
I have a Bash script that processes a text file so that the existing file will look something like this:
/www/repository/2010/201002231329532/LTLO_0407.pdf
/www/repository/2010/201002231329532/LTLO_0507.pdf
/www/repository/2010/201002231329532/LTLO_0607.pdf
/www/repository/2010/201002231329532/LTLO_0707.pdf
/www/repository/2010/201002231329532/LTLO_0807.pdf
Then the script uses a 'For-Do' loop to copy the files to another directory. Unfortunately, the original text file did not pay attention to case. So, when the copy takes place, some of the files are not recognized because of case and are not copied. Looking around for a solution, I did find the 'shopt -s nocasematch' and stuck it in my script, but it spits out errors.
Can someone give me an idea of how I might copy these files without regard for the case?
#!/bin/bash
cd /home/docs/wash_dig_arch
shopt -s nocasematch
sed 's/^\([0-9][0-9][0-9][0-9]\)/\/www\/repository\/\1\/\1/'g /home/docs/wash_dig_arch/serials_3_2010.txt > /home/docs/wash_dig_arch/Serials.txt
sleep 1
for x in `cat /home/docs/wash_dig_arch/Serials.txt`
do
cp $x /home/docs/wash_dig_arch/NEWDOCS/SERIALS
done
shopt -u nocasematch