variables in shell script

Pubblicato il: 19 marzo 2021
sul canale di: BCReddy Devops
192
8

In this video we will discussed variables like local and system and user defined variables along with special variables
special variables
$echo $$=the $ character represents the process ID number, or PID, of the current shell
$0=The filename of the current script
$n=These variables correspond to the arguments with which a script was invoked like $1 $2...$9
$#=The number of arguments supplied to a script.
$*=All the arguments are double quoted. If a script receives two arguments, $* is equivalent to $1 $2.
$@=All the arguments are individually double quoted. If a script receives two arguments, $@ is equivalent to $1 $2.
$?=The exit status of the last command executed.

empl.sh
echo "File Name: $0"
echo "emplid : $1"
echo "emplname : $2"
echo "Quoted Values: $@"
echo "Quoted Values: $*"
echo "Total Number of Parameters : $#"
$echo $?

while running script you just need to pass the arguments
sh empl.sh 10 chinna


In questa pagina del sito puoi guardare il video online variables in shell script della durata di ore minuti seconda in buona qualità , che l'utente ha caricato BCReddy Devops 19 marzo 2021, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 192 volte e gli è piaciuto 8 spettatori. Buona visione!