rmabry
08-23-2002, 11:45 PM
Sorry if this is a newb-brainer. Can someone explain why the outputs of the following two commands differ?
find . -exec lc {} \;
find . -exec echo `lc {}` \;
The command lc is the following simple shell script:
#! /bin/sh
echo $1 | tr "[A-Z]" "[a-z]"
Obviously, all the script does is translate upper to lower case. In a directory containing files having names of mixed case the outputs of the two commands differ. With the first command I get what I'd expect --- the filenames are listed but converted to lowercase. But the second command leaves the names unchanged.
Thanks for the help,
Rick
find . -exec lc {} \;
find . -exec echo `lc {}` \;
The command lc is the following simple shell script:
#! /bin/sh
echo $1 | tr "[A-Z]" "[a-z]"
Obviously, all the script does is translate upper to lower case. In a directory containing files having names of mixed case the outputs of the two commands differ. With the first command I get what I'd expect --- the filenames are listed but converted to lowercase. But the second command leaves the names unchanged.
Thanks for the help,
Rick