-1

So I'm a Unix n00b and I'm trying to add two strings together. One of them is called INSTRUMENT and I want to prefix that with "SA;". I tried doing this but I'm getting an error:

$"SA;"$INSTRUMENTID

Error:

(ERROR) Unable to resolve expression : $"SA;"$INSTRUMENTID

TurtleFan
  • 289
  • 2
  • 17
  • http://stackoverflow.com/questions/4181703/how-can-i-concatenate-string-variables-in-bash Try echo $SA$INSTRUMENT – eliotn Jul 08 '14 at 02:22

1 Answers1

0

You write the variables after each other and prepend the $ sign to them. For example:

#!/bin/bash
a="SA"
b="INSTRUMENTID"
c=$a$b
echo $c

This will print SAINSTRUMENTID

user3814613
  • 249
  • 1
  • 2
  • 11