LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] Strip first three characters from filename

[ILUG] Strip first three characters from filename

Colm Buckley colm at tuatha.org
Mon Aug 11 12:45:38 IST 2008


On Mon, Aug 11, 2008 at 7:15 AM, Andrew McGill <glug at lunch.za.net> wrote:

> On Sunday 10 August 2008 23:03:53 Colm Buckley wrote:
> > I hate that
> > nullglob is not set by default; I can't think of any realistic cases
> where
> > keeping the literal glob is the more expected / less surprising
> behaviour.
> Nullglob allows skipping quotes where they are not absolutely required.
>  This
> trick can be used from knowledge and ignorance:
>        ls | sed s/[^0-9]*//g               # until you have a file named
> s/blah/g
>        echo Would you like a cookie?       # until there a file called
> cookie9
>
> After setting nullglob,
>        shopt -s nullglob
> those work "as expected" by someone who understood the bash man page.  As a
> bonus, being able to leaving off quotes saves on finger strain - a limited
> commodity - and allows you to gently learn about wildcards.


Hah; fun times.  Omission of proper quotes around sed regexps and expected
literals is a corporal offence, though.

Colm

-- 
Colm Buckley / colm at tuatha.org / +353 87 2469146



More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell