SCIENTIFIC-LINUX-USERS Archives

June 2014

SCIENTIFIC-LINUX-USERS@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Reply To:
Date:
Sat, 7 Jun 2014 14:26:11 +0900
Content-Type:
text/plain
Parts/Attachments:
text/plain (16 lines)
I think this is probably an X-Y problem.
http://mywiki.wooledge.org/XyProblem

Something missing is a description what the OP is trying to accomplish.

At least in shell scripts, every time I've thought I needed to declare a 
variable name dynamically it turned out I was missing a better solution 
somewhere. (In the case of metaprogramming I've never found Bash to be the 
right tool.)

On Saturday 07 June 2014 04:41:14 Brandon Vincent wrote:
> eval variable="${x}Status"
> echo ${!variable}
> 
> Brandon Vincent

ATOM RSS1 RSS2