Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Append an environment variable to another one with export

Tags:

bash

shell

I want to append a previously exported string to a new one, so that:

export TAG=img
export FILENAME=$TAG_001.jpg

The result I'd like to obtain is $FILENAME=img_001.jpg, but the export processes it as $TAG_001 instead of $TAG

like image 882
EUS Avatar asked Jun 06 '26 17:06

EUS


1 Answers

Try

export FILENAME=${TAG}_001.jpg
like image 96
YOU Avatar answered Jun 08 '26 07:06

YOU



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!