WIN C.
WIN C.

Reputation: 19

How to export filename together with variable?

My code is:

a = 5335672
cat 1.txt 2.txt 3.txt > file_master_echo $a .txt

Finally, I want output filename to be:

file_master_5335672.txt

Upvotes: 0

Views: 96

Answers (1)

mtnezm
mtnezm

Reputation: 1027

There is no need of using echo there (also must point that is not the proper way to use it). In addition, you cannot leave blank spaces when defining a variable. That said, just try:

a=5335672
cat 1.txt 2.txt 3.txt > file_master_$a.txt

Upvotes: 1

Related Questions