Solved

KSH - Help needed with braces !

Posted on 2011-02-24
2
353 Views
Last Modified: 2012-05-11
Hi,

Starting point :       1.2.3,2.3.4
Desired outcome:  {1.2.3,2.3.4}

Problem :
$ cat test2.ksh 
#!/bin/ksh
MYVAL="1.2.3,4.5.6"
echo ${MYVAL}
echo {${MYVAL}
echo ${MYVAL}}
echo {${MYVAL}}

Open in new window


$ ./test2.ksh 
1.2.3,4.5.6
{1.2.3,4.5.6
1.2.3,4.5.6}
1.2.3 4.5.6

Open in new window


What gives with the last line ??
0
Comment
Question by:TwentyFourSeven
2 Comments
 
LVL 40

Accepted Solution

by:
omarfarid earned 500 total points
ID: 34970052
try

echo \{$MYVAL\}
0
 
LVL 48

Expert Comment

by:Tintin
ID: 34975677
or simply

echo "{$MYVAL}"

Open in new window

0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
Utilizing an array to gracefully append to a list of EmailAddresses
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question