Builtin shell variables

Builtin shell variables are predefined and are global variables that we can use in our script at any point of time. These are reserved shell variables and some of them may have a default value assigned by bash. Some variables' value will depend upon your current shell environment setup. The different type of shell may have a few specific reserved variables to it. All builtin shell variables' name will be in uppercase.

A few reserved shell variables available in bash shell are as follows:

Shell variables available in bash

Description

BASH

This is the absolute path of the current bash being invoked

BASH_VERSION

This is the version number of bash

BASHPID

This is the process ID of the current bash process

EUID ...

Get Linux Shell Scripting Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.