D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Just a silly command line question

 

David Johnson wrote:
> 
> Simply put backticks around the command, e.g.
> 
> cat `date +'%Y%m%d.log'`

Or the modern and trendy $( ) for command substitution in bash.

$ echo $(date +'%Y%m%d.log')

There is a slight difference in how escaping is handled, but whether it
justifies the extra character I'm not sure.

-- 
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/linux_adm/list-faq.html