Shell Variable
noun
say it: “SHEL VAIR-ee-uh-bul” /ˈʃɛl ˈvɛəriəbəl/
A name the shell keeps a value under while the window is open, made with name=value and read back with a dollar sign in front of the name.
What is a shell variable?
A shell variable is a labeled box the shell keeps a value in while the window stays open. Make it with name=value, with no spaces around the =, and read it back with a $ in front of the name. Only the shell you made it in can see it: a program you start can't, until you export it, and closing the window throws it away.
owl_folder=~/terminal-practice/workshop/projects/clockwork-owl
ls $owl_folder
cd $owl_folder
In a sentence
- “Sam kept the long folder path in a shell variable called owl_folder, so cd $owl_folder took him straight there.”
- “The shell variable was gone the moment the terminal window closed.”
Level: Apprentice · More Unix terms at this level
Updated