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] Parameter expansion in the shell

[ILUG] Parameter expansion in the shell

Rory Browne rbmlist at gmail.com
Thu Jan 17 13:58:48 GMT 2008


> Personally I would agree with "some people" because I think
> having two ways to do the same thing - one of which breaks in
> certain circumstances - sucks. Why not just have one which
> works reliably?

One reason would be backward compatability. If you suddenly removed
support for "$foo" then a lot of legacy scripts that depend on this
would break. I don't really see a problem with having the $foo as well
as ${foo}, for the times when you need the chain brackets.

Another example is $( cmd ), which is syntactly similar to the
backtick version ` cmd `. It is however argued ( by David Korn IIRC )
that the $() syntax is better but backticks had to be kept there for
backwards compatability with the Bourne shell.

Also I guess I could use ls --almost-all --classify . I challenge you
to find someone who doesn't perfer to use ls -AF. It's still good to
have the long-form available for scripts ( I think long form should
always be used in scripts - more readable ), but short form is fine
for interactive.




> The need for ${foo} is more common with Cheetah than with
> shell I think...



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