Trying to echo into a file does not work as expected
I have the following function that i am trying to wrong but it does not work as expected. I am trying to echo the latest CVS tag into a file but it does not happen.
getLatestTag () {
if [ ! -f /gamesrc/$1/Makefile ]
then
cd /
cvs co gamesrc/$1/Makefile > /dev/null
fi
# Obtain the line number of the latest tag
cd /gamesrc/$1/
lineNumber=`cvs status -v Makefile | grep -n "Existing Tags" | cut -f1 -d ':'`
lineNumber=`expr $lineNumber + 1`
# Format the latest tag correctly and echo it.
latestTag=`cvs status -v Makefile | sed -n ${lineNumber}p | sed 's/^[ \t]*//' | cut -f1`
echo $latestTag > /latestTag.txt
echo $latestTag
}
|