Author: markt Date: Thu Jul 5 10:57:34 2018 New Revision: 1835120 URL: http://svn.apache.org/viewvc?rev=1835120&view=rev Log: Add "..." when using variables that may contain spaces
Modified: tomcat/trunk/bin/makebase.sh Modified: tomcat/trunk/bin/makebase.sh URL: http://svn.apache.org/viewvc/tomcat/trunk/bin/makebase.sh?rev=1835120&r1=1835119&r2=1835120&view=diff ============================================================================== --- tomcat/trunk/bin/makebase.sh (original) +++ tomcat/trunk/bin/makebase.sh Thu Jul 5 10:57:34 2018 @@ -47,23 +47,23 @@ PRGDIR=`dirname "$PRG"` # first arg is the target directory BASE_TGT=$1 -if [ -z $BASE_TGT ]; then +if [ -z "$BASE_TGT" ]; then # target directory not provided; exit echo "Usage: makebase <path-to-target-directory>" exit 1 fi -if [ -d $BASE_TGT ]; then +if [ -d "$BASE_TGT" ]; then # target directory exists echo "Target directory exists" # exit if target directory is not empty - [ "`ls -A $BASE_TGT`" ] && \ + [ "`ls -A "$BASE_TGT"`" ] && \ echo "Target directory is not empty" && \ exit 1 else # create the target directory - mkdir -p $BASE_TGT + mkdir -p "$BASE_TGT" fi for dir in bin lib logs temp webapps work; --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org