{ads}

Concatenating strings, incrementing numbers and using += in bash



May 26, 2022 at 03:10AM

It's quite easy to get bash to concatenate strings and do simple math on Linux, but there are a number of options for you to use. This post focusses on concatenating strings, but also shows how one of the operators (+=) also plays a primary role in incrementing numbers.

Concatenating strings

In general, the only time that you'd want to concatenate strings on Linux is when one string is already defined and you want to add more to it. For example, if you have a script that greets the person running it, you might set up a string in the script to prepare the greeting and then add the person's username or name before displaying it.



from Network World https://ift.tt/fCug8n9

0 Response to "Concatenating strings, incrementing numbers and using += in bash"

Post a Comment

Article Top Ads

Central Ads Article 1

Middle Ads Article 2

Article Bottom Ads