Linux Shell Script Variable Assignment

In bash variable assignment looks like this: set to the empty string).

Bash variables don’t need to be all-caps but they usually are. There are also some array variables in bash but I don’t really understand those.

User variables are case sensitive, so the variable Var1 is different from the variable var1.

This little rule often gets novice script programmers in trouble.

I do not do complicated programming in bash and do not really plan to learn how to.

Sometimes, you may want to store the output of a command in a variable to be used in a later operation.

While this doesn’t seem like much, it is a major building block in script programming.

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Generally these variables are defined in CAPITAL LETTERS.

We can see these variables by using the command “$ set“.

Leave a Reply

Your email address will not be published. Required fields are marked *

One thought on “Linux Shell Script Variable Assignment”