KSH - Help needed with braces !

Posted on 2011-02-24
Last Modified: 2012-05-11

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

Problem :
$ cat test2.ksh 
echo ${MYVAL}
echo {${MYVAL}
echo ${MYVAL}}
echo {${MYVAL}}

Open in new window

$ ./test2.ksh 
1.2.3 4.5.6

Open in new window

What gives with the last line ??
Question by:TwentyFourSeven
LVL 40

Accepted Solution

omarfarid earned 500 total points
Comment Utility

echo \{$MYVAL\}
LVL 48

Expert Comment

Comment Utility
or simply

echo "{$MYVAL}"

Open in new window


Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This Windows batch file is useful for organizing image files from a digital camera or other source, but can have many other uses.  It simply renames the file(s) to match their create date.  For example, if you took a picture today at 1:40pm and the …
The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

771 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now