Last update at :2024-04-23,Edit by888u
Source: https://itsfoss.com/bash-use-variables/
Basics in Bash In the first part of the series, I briefly mentioned variables. Now it's time to learn about them in detail in this chapter.
If you have ever done any kind of coding, you are familiar with the term "variable".
If not, think of variables as boxes that hold information that can change over time.
Let's see how to use them.
Using variables in the Bash shell
Open a terminal and initialize the variable with a random number 4: < /p>
var=4
Now you have a variable named var with a value of 4. Want to verify? Access the value of a variable by prepending $ to the variable name. This is called parameter expansion.
echo The value of var is $var The value of var is 4
All copyrights belong to 888u unless special state
发表评论