Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: From: klaus DOT berndl AT sdm DOT de To: cygwin AT sourceware DOT cygnus DOT com, klaus DOT berndl AT sdm DOT de Subject: AW: Problem with basename Date: Fri, 16 Feb 2001 15:40:49 +0100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id JAA06746 No, i donīt have any special characters in the filenames. And renaming $file in $F doesnīt help too. Hmm, very mysterious! Thanks, Klaus > > klaus DOT berndl AT sdm DOT de wrote: > > > > 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 .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? > > > > Not really. Do you have any *.el files with whitespace characters or > any non alphanumeric characters in the filename? > > You could modify your script to have the for loop call the > function. I > would also not use the work `file' as a variable name. I would change > it to `File' or just F to prevent confusion with the executable of the > same name. > > Earnie. > > > _________________________________________________________ > > Do You Yahoo!? > > Get your free @yahoo.com address at http://mail.yahoo.com > > > > > -- > Want to unsubscribe from this list? > Check out: http://cygwin.com/ml/#unsubscribe-simple > -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple