What does #!/usr/bin/ksh
means in shell scripting?
It is the first line in a shell script always
it signals os that
the script is to be executed by ksh (instead of any of the other shells)
shebang is the character sequence consisting of the characters number sign and exclamation mark (#!)
What do $? $0 $1 $2
mean in shell script?
These are positional arguments of the script.
clone_dbapps.sh OSPT
APPSONLY NOCOPY_APPSBIN ( here $0 –
clone_dbapps.sh, $1 – OSPT and so on )
If parameter to clone_dbapps.sh
is less than 1 then it would ask Usage
test
is an program
which lets you perform various tests
Executing:
if test $# -lt 1
then
echo
echo
echo " Usage: $0
SID APPSONLY(optional) NOCOPY_APPSBIN(optional)"
echo
exit 9
fi
Whats the use of awk and substrr ?
substr(s, a, b) :
it returns b number of chars from string s,
starting at position a. The parameter b is
optional.
Awk prints the
output .
export I=`echo $1|awk '{ print
substr($1,1,1)}'`
clone_dbapps.sh OSPT will return O
No comments:
Post a Comment