8

I want to concatenate string and int. But it doesn't work with & and add operator.

echo "abc" & 2

But it doesn't work.

frogEye
  • 364
  • 3
  • 14

1 Answers1

15

There's an operator $ that converts something to string.

echo "abc" & $2
echo "abc", 2 # echo automatically applies `$` to its arguments
uran
  • 1,346
  • 10
  • 14