From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Brewer, Edward" Newsgroups: gmane.os.tru64.managers Subject: KSH question Date: Thu, 16 May 2002 11:54:21 -0400 Sender: tru64-unix-managers-owner@ornl.gov Message-ID: <7B386924C5CAD0428322085D0F0F766F60AC12@ODEXC4> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 X-Trace: main.gmane.org 1021564560 13556 127.0.0.1 (16 May 2002 15:56:00 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 16 May 2002 15:56:00 +0000 (UTC) Return-path: Original-Received: from sws1.ctd.ornl.gov ([160.91.20.101]) by main.gmane.org with smtp (Exim 3.33 #1 (Debian)) id 178Nbj-0003WX-00 for ; Thu, 16 May 2002 17:55:59 +0200 Original-Received: (qmail 31770 invoked by uid 5); 16 May 2002 15:56:18 -0000 Original-Followup-To: poster Precedence: bulk Original-Received: (qmail 31762 invoked from network); 16 May 2002 15:56:18 -0000 Original-Received: from unknown (HELO emroute3.ornl.gov) (134.167.3.110) by 0 with SMTP; 16 May 2002 15:56:18 -0000 Original-Received: from emroute3.ornl.gov (localhost [127.0.0.1]) by emroute3.ornl.gov (PMDF V6.1-1 #39060) with ESMTP id <0GW700BE0O9TJH@emroute3.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Thu, 16 May 2002 11:56:17 -0400 (EDT) Original-Received: from ims.hub.nih.gov (ims.hub.nih.gov [128.231.90.111]) by emroute3.ornl.gov (PMDF V6.1-1 #39060) with ESMTP id <0GW700B82O7GE0@emroute3.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Thu, 16 May 2002 11:56:13 -0400 (EDT) Original-Received: by ims.hub.nih.gov with Internet Mail Service (5.5.2655.55) id ; Thu, 16 May 2002 11:54:52 -0400 Content-return: allowed Original-To: "'Tru64-Unix-Managers \(E-mail\)" X-Mailer: Internet Mail Service (5.5.2655.55) Xref: main.gmane.org gmane.os.tru64.managers:232 X-Report-Spam: http://spam.gmane.org/gmane.os.tru64.managers:232 Admins, I have run into a problem concerning ksh. I need to call up the value of a variable into another variable but must define the variable with variables. Here is an example of what I am referring to. Let's say I have the following variables SYSTEM_ABCD=1234 EXT=abcd I need to command 1234 where SYSTEM_ABCD is defined by EXT SYSTEM_$EXT I could hard code the value, but I want it to read EXT to find SYSTEM_$ABCD because I have other values for other systems such as SYSTEM_EFGH=5678 so, I did the following Variable list..... SYSTEM_ABCD=1234 EXT=abcd Variable list ends ... INST=`echo EXT | tr -s '[:lower:]' '[:upper:]'` # convert to uppercase PASS = `echo '$SYSTEM_'$INST` echo $PASS command $PASS the result is that echo $PASS gives $SYSTEM_ABCD and the command fails, because it pass $SYSTEM_ABCD instead of 1234. I have tried several tricks and combinations and they have had all of the same results. I know I have done this in the past but I can't figure out how to make the shell interpret the string instead of treating it literal. TIA, Lee Brewer