help-bash
[Top][All Lists]
Advanced

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

Re: [Help-bash] getting weird output out of 'echo' w/args


From: Dan Douglas
Subject: Re: [Help-bash] getting weird output out of 'echo' w/args
Date: Mon, 03 Jun 2013 03:36:40 -0500
User-agent: KMail/4.10.3 (Linux/3.9.4-pf+; KDE/4.10.3; x86_64; ; )

On Thursday, May 30, 2013 11:15:20 AM Roman Rakus wrote:
> Changing the list to help-bash, I think this belongs here.
> 
> This is common misconception about filename expansion (globbing). Since 
> globbing is done nearly always (*) people know only about "star" 
> character. The fact is that "star", "question mark" and "opening 
> bracket" (*, ?, [) all have special meaning for globbing. See 
> http://www.gnu.org/software/bash/manual/bashref.html#Filename-Expansion
> 
> Many times I saw using tr like this:
> somecommand | tr -s [a-z] ''
> somecommand | tr -s [:space:] ' '
> 
> Please note that argument for tr undergo globbing (by bash), because it 
> is not quoted.
> 
> RR
>

Yes. {fail,no}glob can help debugging a bit. A more useful feature would be to 
fail whenever the first word of a simple command resulted from anything that 
could have been interpreted as a glob, whether it matched files or not. Also 
any other context where globing never ever makes sense. Other glob options are 
too intrusive and are only useful when you aren't going to glob, or to toggle 
temporarily.
-- 
Dan Douglas



reply via email to

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