SCIENTIFIC-LINUX-USERS Archives

November 2006

SCIENTIFIC-LINUX-USERS@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show Text Part by Default
Condense Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Sender:
Mailling list for Scientific Linux users worldwide <[log in to unmask]>
Date:
Wed, 29 Nov 2006 20:16:20 +0100
MIME-version:
1.0
Reply-To:
KELEMEN Peter <[log in to unmask]>
Content-disposition:
inline
Content-type:
text/plain; charset=utf-8
Subject:
From:
KELEMEN Peter <[log in to unmask]>
Content-transfer-encoding:
QUOTED-PRINTABLE
In-Reply-To:
<001901c713e8$a9136730$0901a8c0@TShirtLap>
Organization:
CERN European Laboratory for Particle Physics, Switzerland
Comments:
Parts/Attachments:
text/plain (25 lines)
* Manuel Mussini ([log in to unmask]) [20061129 20:00]:

> Does anybody know why this sequence does not work (under bash on
> SLF3.0.5)?

> ext="log"
> files=`find . -name '*.${ext}' -print`
> echo $files

The shell does not expand variables in single quotes.  Try this:

	files=`find . -name "*.${ext}" -print`

Please be aware that you will run into trouble should you have too
many *.log files (and/or long paths) -- the shells don't cope very
well with extremely long variables.

HTH,
Peter

-- 
    .+'''+.         .+'''+.         .+'''+.         .+'''+.         .+''
 Kelemen Péter     /       \       /       \     [log in to unmask]
.+'         `+...+'         `+...+'         `+...+'         `+...+'

ATOM RSS1 RSS2