Comentários (4)

1 KrausWol comentou às Link permanente

Do NOT use backticks! Instead use $(). Backticks have some disadvanteges, read more here: http://mywiki.wooledge.org/BashFAQ/082

2 Himanshuz.chd comentou às Link permanente

@KrausWol <br /> Thanks a lot for the valuable information.

3 geohump comentou às Link permanente

I would like to add something to what Kraus Wol said. <div>&nbsp;</div> As he said $( some command) is a better way to go than the backticks. <div>&nbsp;</div> One reason why is nesting. Backticks can't be nested. $() can. <div>&nbsp;</div> Example: <br /> echo Your next appointment is at $(egrep "Appointment time" $(grep bob $MyFile | awk '{print $5 }'; ) | sed -e 's/^appoint[^:]*://') <div>&nbsp;</div> The demo is a bit contrived, but it is not more complex then things people find themselves doing.

4 Himanshuz.chd comentou às Link permanente

@geohump <br /> I agree, using $() is a better practice as nesting is a useful feature. Your example could be a bit complex for some people though. :-)