Tuesday, September 16, 2008

Bash : concatenate strings in bash

The problem -

You have $yr=2008
You want to obtain something like 2008_data.csv etc

$yr_data.csv does not work

The solution - Use curly braces to separate variables from strings
like this

${yr}_data.csv

3 comments:

petertparker said...

Hi Nice Blog You have a great idea for a website. You haven’t thought it through much yet, but you want to go out and see how much it’s going to cost to have it developed for you. After all, the sooner you get a web development services started on it the sooner it will get built. Right?

Admin said...

Hi,

Hope you are doing well. 9.9 media is starting a new initiative
http://www.createonlinebuzz.com/ . If you are interested in making money
through your blog by occasionally writing reviews of products and services
please log onto http://www.createonlinebuzz.com/ and register as a
blogger.


Best Wishes
S Malhotra

Ketan said...

Thanks for your input. I'll certainly think over it.