yichao firstname, zeaster nickname, zhang lastname

Notes about shell.

1 [ -h file ], true if the file is a soft link. (guess from hadoop-deamon.sh)
2 echo $?, return the last command exit status.

code snippet from hadoop-deamon.sh

this="$0"
while [ -h "$this" ]; do
ls=`ls -ld "$this"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '.*/.*' > /dev/null; then
this="$link"
else
this=`dirname "$this"`/"$link"
fi
done

No comments: