help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] Use one line for myvar=XXX cat <(echo "$myvar")


From: Chris F.A. Johnson
Subject: Re: [Help-bash] Use one line for myvar=XXX cat <(echo "$myvar")
Date: Sun, 21 Jul 2013 21:21:12 -0400 (EDT)
User-agent: Alpine 2.00 (LMD 1167 2008-08-23)

On Sun, 21 Jul 2013, Peng Yu wrote:

Hi,

myvar=XXX cat <(echo "$myvar")

myvar in <() won't get the value XXX. I could use export to split the
above line into two lines as in the following.

export myvar=XXX
cat <(echo "$myvar")

But is there an one line command for it? Thanks.

myvar=XXX; cat <(echo "$myvar")

--
   Chris F.A. Johnson, <http://cfajohnson.com/>
   Author:
   Pro Bash Programming: Scripting the GNU/Linux Shell (2009, Apress)
   Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]