ScriptingLesson 46Free preview
Bash Variables
This lesson is part of Bash · All levels
Summary
The Bash variable stores reusable text with the $ sign. The writing should be NAME=value with no spaces around the equals sign, and then read $NAME or ${NAME}. The variable is local unless exported with export to be available for the child program.
Key points
- Name=NILLAI without spaces, example name=Budi
- Use $name or ${name} to read the value
- Export makes the variable available for the next program
- Readonly locks and deletes the variable
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.