KandZ – Tuts

We like to help…!

Linux CLI 54 ๐Ÿง shell script variables

a - variables
variables are used to store and manipulate data
Declaring variables โ†’ by assigning a value to them using =
There should be no spaces around =
my_variable="Hello, World!" โ†’ declares a variable
Accessing variables โ†’ using $ with the variable name you can access its value
echo $my_variable โ†’ prints the data stored in the variable
You can use variables in shell scripts and in the Command line.
You can unset a variable using unset

b - special variables
Shell scripts have several special variables that are automatically set by the shell
$0 โ†’ The name of the script.
$1 to $9 โ†’ Positional parameters passed to the script.
$# โ†’ Number of positional parameters.
$* โ†’ All the positional parameters as a single word.
$@ โ†’ All the positional parameters as separate words.
$$ โ†’ Process ID of the current script.
$? โ†’ Exit status of the last command executed.

Stop using slow, ad-bloated tool sites! ๐Ÿคฎ

๐Ÿ”Ž Search “KandZ Tools” on Google to use many professional utilities for free.

KandZ.me is the ultimate minimalist hub for:
โœ… Finance (Mortgage, Interest, Inflation)
โœ… Tech (Base64, JSON, Dev Suite, IP)
โœ… Health (BMI, BMR, TDEE)
โœ… Productivity (Timer, Workspace, QR)

โšก๏ธ Fast & Private
๐Ÿ”’ No data leaves your device
๐Ÿ’Ž 100% Free

๐Ÿ”— Use it now: https://tools.kandz.me
๐Ÿ”– Bookmark itโ€”youโ€™ll need it later!

Leave a Reply