Variables

We already described what variables are and how to define them in Chapter 1, The What and Why of Scripting with Bash.

Just to refresh your memory, you can define a variable by assigning a value with an equals sign and without any spaces like this:

#!/bin/bashmyvar=15myvar2="welcome"

So nothing new here.

Get Mastering Linux Shell Scripting now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.