Quote:
Originally Posted by purna.cherukuri
Dear Dennis,
Thank you for a prompt response....
Can you tell me wht x%% refers... As i am new to shell scripting, i am not able to understand the code snippet you have given...
Can you please explain how this works... So that i can tailor it according to my requirement....
Thank you...
|
Sorry, It was a typo, the modified script is
Code:
#look for all the .ctl files
for each in $(ls -1 *.ctl)
do
#extract the filename without ctl extention and search for {filename}.txt
# if it is there, move to a different folder
[[ -f "${each%%.ctl}.txt" ]] && { mv ${x%%.ctl}.txt ./new_folder/ }
done