Jay Roy
asked on
understanding .ksh
hi guys
we have inherited some .ksh files which we are trying to understand.
I have some questions in the below .ksh file
thanks
we have inherited some .ksh files which we are trying to understand.
I have some questions in the below .ksh file
if [ "$#" -lt 1 ]; then --does this mean paramatres less than 1 ?
echo "Usage: $0 $1 <config file>"
exit 1
fi
SCRIPT_PATH="${BASH_SOURCE[0]}"; --what is BASH_SOURCE[0] mean here?
if([ -h "${SCRIPT_PATH}" ]) then --what does this mean?
while([ -h "${SCRIPT_PATH}" ]) do SCRIPT_PATH=`readlink "${SCRIPT_PATH}"`; done --what does this mean?
fi
thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks
ASKER
>>[ -h "${SCRIPT_PATH}" ] tests whether the name found with ${BASH_SOURCE[0]} exists and is a symbolic link..
can you please tell me what is a symbolic link ?
can you please tell me what is a symbolic link ?
A symbolic link is an entry in a filesystem (a special type of file) which contains a reference to another directory or file.
A symbolic link is "transparent" to most applications, which means that you can work with the link as you could with the original file. The filesystem will forward requests against the link to the original file or directory.
A symbolic link is "transparent" to most applications, which means that you can work with the link as you could with the original file. The filesystem will forward requests against the link to the original file or directory.
ASKER
thanks
ASKER
any help will be greatly appreciated.
https://www.experts-exchange.com/questions/28254996/uderstanding-ksh-part-2.html
thanks.
https://www.experts-exchange.com/questions/28254996/uderstanding-ksh-part-2.html
thanks.
>> --does this mean paramatres less than 1 ? <<
Yes, $# contains the number of command line parameters.
[ ] indicates a test, and -lt means "less than"
Please note that "--" does not start a comment! ksh comments start with "#"