This is the mail archive of the
cygwin@sources.redhat.com
mailing list for the Cygwin project.
Problem with basename
- To: cygwin at sourceware dot cygnus dot com
- Subject: Problem with basename
- From: klaus dot berndl at sdm dot de
- Date: Fri, 16 Feb 2001 15:13:48 +0100
i have written the following function:
function check-el-compile ()
{
for file in $*; do
elcfile=`basename $file .el`.elc
if [ ! -f "$elcfile" ]; then
missinglist="$missinglist $file"
fi
done
echo "Not compiled Files: $missinglist"
unset el elc missinglist
}
This function checks which of the passed *.el files are not compiled, i.e. the file <basename>.elc
does not exist. Example: abc.el is compiled if abc.elc exists in the same directory.
Now the problem: if i pass the *.el files as argument to this function all is working fine.
But if i write the functon like follows:
function check-el-compile ()
{
for file in `ls *.el`; do
# same as above.
then the basename call doesn´t work, i.e. it always returns $file.
It seems that the output of ls contains "something" which confuses basename?!
Any ideas what can be the problem?
many thanks in advance!
Klaus
--
Klaus Berndl mailto: klaus.berndl@sdm.de
sd&m AG http://www.sdm.de
software design & management
Thomas-Dehler-Str. 27, 81737 München, Germany
Tel +49 89 63812-392, Fax -220
--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple