Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
How can I concat strings in shell? Is it just...
var = 'my'; var .= 'string';
?
=
How about this:
var="${var}string"
Add a comment
It depends on the shell, but since question was tagged bash:
var='my' var=$var'string'
No. For various reasons.
# most sh-compatible shells var="my" var="$var string" # advanced shells var="my" var+=" string"
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.
=. It has to be next to the name and the value.