linux - concatenateing string variables overwrites them -


i have problem concatenate 2 string variables. second variable overwrites first one.

script:

subject1=$(grep -e -o "exit.{0,12}" 123.log) subject2=$(grep transferred: 123.log) completesubject="$subject1 / $subject2" echo $completesubject 

subject1 contains exit status 0, while subject2 contains transferred: sent 308464915408, received 11704 bytes, in 14844.1.

now completesubject results in / transferred: sent 308464915408, received 11704 bytes, in 14844.1 seconds, want exit status 0 / transferred: sent 308464915408, received 11704 bytes, in 14844.1 seconds.

what problem?


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -

Why does a .NET 4.0 program produce a system.unauthorizedAccess error on a Windows Server 2012 machine with .NET 4.5 installed? -