2008/9/19 Matthew Wild <[EMAIL PROTECTED]>: > On Fri, Sep 19, 2008 at 1:39 PM, Johnathon Tinsley <[EMAIL PROTECTED]> wrote: >> Thanks! :) >> >> Using ls -l `which firefox` we worked out that we were calling the wrong >> binary. Out of interest, whats the difference between $(command) and >> `command` in bash shell? >> > > Nothing but readability, as far as I am aware. I use `this` myself, > but $() when writing for other people, otherwise I have to get into a > long discussion about the difference between ` and ' and where to find > it on the keyboard :)
I've just checked the bash man page, and there's no difference. Using backquotes is described as the old style. OK, there is one difference; when it comes to nesting commands, you have to quote the nested opening/closing backquotes, or they are taken as the end of the first command. There's no need to quote the opening $( though. As Matthew said, it's all down to readability... Hwyl, Neil. -- ubuntu-uk@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk https://wiki.ubuntu.com/UKTeam/