Special Variables

Last updated

What is Special Variables?

Special variables in shell scripting are predefined variables that automatically hold specific values related to the shell's operation or the script's execution environment. These variables provide access to information like the script's name, the number of arguments passed to it, the exit status of the last command, and process IDs. They are read-only in most cases, meaning you can't directly modify their values, but you can use them to make decisions and control the flow of your scripts.

Free resources to learn Special Variables

More in stage 15: Bash Data Types

Special Variables: common questions

Can I learn Special Variables in Hindi?

This lesson is written in English. Once you sign in, open it in the interactive course and ask the AI tutor to explain Special Variables in Hindi or Hinglish. The tutor answers from this lesson’s own text, so it stays on the syllabus, and it runs on your own Google, OpenAI or Anthropic key.

Is this Special Variables tutorial for beginners?

It is lesson 74 of 166 in the free Shell / Bash roadmap, in stage 15, Bash Data Types. If you are new to Shell / Bash, start from stage 1 and come back here in order; if you already know the earlier stages, this lesson stands on its own.

Still confused? Ask me