Language elements
2.1 Variables
The traditional first program in any language prints out “Hello world”. Here is a shell script that
illustrates the use of variables:
#!/bin/bash
# to use a variable, just assign it
sayIt="Hello"
sayit=$sayIt" world"
echo $
In bash scripts, # denotes a comment, and blank lines are allowed. The first line above is a comment
to Unix, that the script should be executed with bash.
In the script above, sayIt is first assigned the value “Hello”. Then, sayIt is assigned its old value,
concatenated with “ world”. The value of a variable is accessed with $.
Shell variables need not be “declared” or “defined” first; just start using them. Shell variables do
not have “types” (integer, real, string, etc.). More precisely, all shell variables are strings, but can
be interpreted and used as integers.
#BASH
Share And Support Us
t.me/Termux_For_Android
2.1 Variables
The traditional first program in any language prints out “Hello world”. Here is a shell script that
illustrates the use of variables:
#!/bin/bash
# to use a variable, just assign it
sayIt="Hello"
sayit=$sayIt" world"
echo $
In bash scripts, # denotes a comment, and blank lines are allowed. The first line above is a comment
to Unix, that the script should be executed with bash.
In the script above, sayIt is first assigned the value “Hello”. Then, sayIt is assigned its old value,
concatenated with “ world”. The value of a variable is accessed with $.
Shell variables need not be “declared” or “defined” first; just start using them. Shell variables do
not have “types” (integer, real, string, etc.). More precisely, all shell variables are strings, but can
be interpreted and used as integers.
#BASH
Share And Support Us
t.me/Termux_For_Android
Telegram
Termux Hackers (Users)
╔╦╦╦═╦╗╔═╦═╦══╦═╗
║║║║╩╣╚╣═╣║║║║║╩╣
╚══╩═╩═╩═╩═╩╩╩╩═╝
Use This bot to contact with us
@Bot_Nospam_Bot
Check This bot @TermuxForAndroidBot
║║║║╩╣╚╣═╣║║║║║╩╣
╚══╩═╩═╩═╩═╩╩╩╩═╝
Use This bot to contact with us
@Bot_Nospam_Bot
Check This bot @TermuxForAndroidBot