{i%l} already exists
else
mv $i ${i%l}
fi
done
Substitution
Another kind of variable mangling y... n into a list of filenames (called "globbing") is done by the shell -- before the command is executed. T... result:
for i in *.txt; do cp $i ${i%.txt}.bak; done
... obviously this is more typing. If you tried ... ion cp-pattern { for i in $1; do cp $i ${i%$1}$2; done
... but that doesn't work like most Unix users w