_WORLD.TXT when sent to a terminal would show as _WORLD.TXT (overriding the Hello). I am trying to use VBA to place a formula in a cell that is a concatenation of two cells using an underscore between them. How to append substrings in a string in bash or shell script? Variables are named symbols that represent either a string or numeric value. If the file does not exist then the file will be created and the value of $combine will be added at the beginning of the file. Create a file named, ‘concat4.sh‘ and add the following code. The middle $() returns nothing and breaks the two variables apart. Two variables, $string1 and $string2 are initialized with string data and stored in another variable, $string3. Your solution worked great after that. The values are stored in the $foods variable. But, in the spirit of user208145’s answer, here’s an alternative: You can also use this: separate the separate vars with spaces and concatenate them using tr to remove the space. The first example is a general way to concatenate variables of string. The string data can be combined easily in bash by placing one after another or by using shorthand operator. As this question stand specifically for Bash, my first part of the answer would present different ways of doing this properly: +=: Append to variable. It seems reasonable to think that this: will read a trailing carriage return \r if reading from a windows file. Making statements based on opinion; back them up with references or personal experience. read -r filename