Notes on Java, Solaris, PHP, LDAP…

June 20, 2008

Concatenating strings and variables in shell

Filed under: Java — negev @ 5:44 pm

I had a variable and I wanted to concatenate its value with a string – in a Unix shell script (run by sh or bash). It turns out that quotation marks work well. Apostrophes don’t work all the time. An example:

echo Go “$HOME” — “$HOME”


Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at

%d bloggers like this: