bug-sh-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

basename


From: Gerald Engl
Subject: basename
Date: Tue, 17 Oct 2000 16:05:17 +0200

Hello there at GNU

I don´t really know wether this is a bug or not, but I simply don´t
understand the way "basename" (on a SuSE 6.4 [basename (GNU sh-utils)
2.0 Written by FIXME unknown]) is acting.
I try to cut off the suffixes of files in a directory, for example the
suffix is .img and do the following:

bash-2.03# for i in `ls -1 *.img`
> do
> basename $i .img
> done

The result is:

select1.img
select2.img
select3.img

What is obviously not the result I wanted.

Just to give it another try I packed all the stuff in a small script:

---
#!/bin/bash

for i in `ls -1 *.img`
do
basename $i .img
done
---

The "script" is producing the correct output:

select1
select2
select3

Well, I simply don´t have a clue what is the difference between the
above or is it really a bug?

If possible, please give me some hint to understand this.

Thank you in advance,

Gerald Engl  

-- 
Gerald Engl
SICAD Geomatics GmbH &Co oHG
Otto-Hahn-Ring 6 | 81739 München
Tel.: 0049-89-636-51305



reply via email to

[Prev in Thread] Current Thread [Next in Thread]