hi,
in a shell script i came accross the following bit of code
1.shift $(($OPTIND - 1))
2.if [ $# -eq 0 ] ; then
3. cat << EOF >&2
4.Usage: $0 [-l|-u] [-r retries] lockfilename
5.EOF
6. exit 1 7.fi
I am not able to understand the meaning of lines(1,3,5).
Can any one of u tell me the purpose of above said lines.
cheers
RRK
A here document is a specialpurpose code block. It uses a form of I/O redirection to feed a command list to an interactive program or a command( here it is cat ).
A limit string(here EOF) delineates the command list. The special symbol << designates the limit string.