Re: `backticks` or $(command) syntax

2006-03-08 Thread Bruce Dubbs
Dimitry Naldayev wrote: > Bruce Dubbs <[EMAIL PROTECTED]> writes: > >> Randy McMurchy wrote: >> >>> Just for the record, I'll go out on a limb (not really on a limb as >>> I can prove it with real life, actual circumstances) that the >>> $(...) syntax will work in situations where `...` will not.

Re: `backticks` or $(command) syntax

2006-03-01 Thread Randy McMurchy
On Tue, 2006-02-28 at 20:35 -0600, I wrote: > echo ${BIGSTRING} | sed "s/^.*\($MYSTRING\).*$/\\${COUNTER}/" > > The word "string" was returned, as expected. > > JUSTFORBRUCE=`echo ${BIGSTRING} | sed "s/^.*\($MYSTRING\).*$/\\${COUNTER}/"` > > echo $JUSTFORBRUCE > > Woops, we didn't get what we

Re: [Fwd: Re: `backticks` or $(command) syntax]

2006-03-01 Thread Archaic
On Wed, Mar 01, 2006 at 11:11:43AM -0600, Randy McMurchy wrote: > > I sent this to the dev list, but it didn't seem to get there. > I'll wait a day or so and see what happens, but in the meantime, > you may want to retract your statements, as they are a total > falsehood. Yes, after review I see

Re: `backticks` or $(command) syntax

2006-03-01 Thread Jeremy Huntwork
Randy McMurchy wrote: Is that better phrasing? Yep. :) And this discussion was good for showing us that `...` doesn't work in exactly the same way as $(...), so thank you. As I said, my vote is for $(...) in the book except for perhaps one instance of `...` for educational value. -- JH

Re: `backticks` or $(command) syntax

2006-03-01 Thread Randy McMurchy
On Wed, 2006-03-01 at 07:12 -0500, Jeremy Huntwork wrote: > Granted, the $(...) may be easier to work with because of these caveats, > but as it seems the behavior is known and documented, I'm not sure it's > correct to say that `...` is broken. I will retract the "broken" and would like to rep

Re: `backticks` or $(command) syntax

2006-03-01 Thread Randy McMurchy
Archaic wrote these words on 03/01/06 01:02 CST: > Oh bollocks! Not sure what bollocks means, but if it means "I'm totally confused, on what the original statement is, but I'll post something anyway", then it is an accurate word. > Wrong: > JUSTFORBRUCE=`echo ${BIGSTRING} | sed "s/^.*\($MYSTRING

Re: `backticks` or $(command) syntax

2006-03-01 Thread Bruce Dubbs
Rainer Peter Feller wrote: > Not that I am the one to decide ... > but what is easier to "read" > sed s%"`which bash`"%"'echo '/tools/bin/bash'`"% -i /somescript.sh > or > sed s%"$(which bash)"%$(echo '/tools/bin/bash')"% -i /somescript.sh > > if you read a book? Wow. I don't think either is v

Re: `backticks` or $(command) syntax

2006-03-01 Thread Bruce Dubbs
Randy McMurchy wrote: > Bruce Dubbs wrote these words on 02/28/06 21:36 CST: > Otherwise, you must concede that the constructs produce different > results. And, looking at the example I provided, one is broken, > one is not. Certainly the constructs you provided produce different results. Did I

Re: `backticks` or $(command) syntax

2006-03-01 Thread Jeremy Huntwork
Bruce Dubbs wrote: No. But the behavior is documented in the bash man page: "When the old-style backquote form of substitution is used, backslash retains its literal meaning except when followed by $, `, or \. The first backquote not preceded by a backslash terminates the command substitution

Re: `backticks` or $(command) syntax

2006-02-28 Thread Tushar Teredesai
On 2/28/06, Randy McMurchy <[EMAIL PROTECTED]> wrote: > > Does anybody know right offhand if $(command) syntax is a bash-only > thing? > I think it is bash only. Definitely not compatible with sh. On the system at work: $ uname -a OSF1 server V5.1 2650 alpha $ /bin/sh -c 'echo $(ls)' /bin/sh: sy