[Techtalk] BASH command subsitution

Sara Falamaki saraf at cse.unsw.edu.au
Sun Sep 7 18:19:09 EST 2003


Common mistake, you're using the wrong type of quotes.  Use
back ticks (above your tab button, under the ~ on a US keyboard),
instead of single quotes.  

ie:
echo todays date is `date`

cheers,
Sara

On Sun, Sep 07, 2003 at 01:17:50PM +0700, Robin Hood wrote:
> I have been working through my Unix textbook and am up to the chapter on the
> Bourne shell.
> I am up to the section on command subsitution.
> According to my textbook typing:
> 
> $ echo the date today is 'date'
> 
> should result in something like:
> 
> the date today is Mon Feb 2 00:41:55 CST 1998
> 
> However. When I type this into my Linux box (SuSE 8.0)
> All I get is:
> 
> todays date is date.
> 
> I have also tried the following:
> 
> $ echo 'ls'
> ls
> $ echo 'pwd'
> pwd
> 
> It seems that command subsitution does not work under bash (at least on my
> computer anyway).
> Has anybody else ever had this problem?
> Is it a bug? or am I doing something really stupid?
> 
> 
> *****A Network is the Opposite of a Hierachy*****
> 
> _______________________________________________
> Techtalk mailing list
> Techtalk at linuxchix.org
> http://mailman.linuxchix.org/mailman/listinfo/techtalk
> 

-- 


More information about the Techtalk mailing list