Reputation: 364
I want to concatenate string and int. But it doesn't work with & and add operator.
echo "abc" & 2
But it doesn't work.
Upvotes: 8
Views: 2796
Reputation: 1336
There's an operator $
that converts something to string.
echo "abc" & $2
echo "abc", 2 # echo automatically applies `$` to its arguments
Upvotes: 15