Revision: 73081
          http://sourceforge.net/p/brlcad/code/73081
Author:   brlcad
Date:     2019-05-17 13:41:25 +0000 (Fri, 17 May 2019)
Log Message:
-----------
make sure we quote before echo so it doesn't expand '*' to a list of files

Modified Paths:
--------------
    brlcad/trunk/sh/header.sh

Modified: brlcad/trunk/sh/header.sh
===================================================================
--- brlcad/trunk/sh/header.sh   2019-05-17 13:25:52 UTC (rev 73080)
+++ brlcad/trunk/sh/header.sh   2019-05-17 13:41:25 UTC (rev 73081)
@@ -50,6 +50,7 @@
 #   find src -type f \( -name \*.c -or -name \*.h \) -not -regex '.*src/lib.*' 
-exec sh/header.sh BSD {} \;
 #
 ###
+set -x
 
 LICE="$1"
 FILE="$2"
@@ -353,7 +354,7 @@
 if [ "x$copyrightline" = "x" ] ; then
     copyrightline="`grep -i copyright $FILE | grep -v -i united | grep -v -i 
'\.SH' | head -n 1`"
 fi
-copyrightline="`echo $copyrightline | head -n 1`"
+copyrightline="`echo "$copyrightline" | head -n 1`"
 
 echo "copyrightline is [$copyrightline]"
 
@@ -363,16 +364,16 @@
 else
     startyear="`echo "$copyrightline" | sed 
's/.*\([0-9][0-9][0-9][0-9]\)-[0-9][0-9][0-9][0-9].*/\1/'`"
     echo "start is $startyear"
-    if [ `echo $startyear | wc | awk '{print $3}'` -gt 10 -o "x$startyear" = 
"x" ] ; then
+    if [ `echo "$startyear" | wc | awk '{print $3}'` -gt 10 -o "x$startyear" = 
"x" ] ; then
        startyear="`echo "$copyrightline" | sed 
's/.*[^0-9]\([0-9][0-9][0-9][0-9]\),[0-9][0-9][0-9][0-9],[0-9][0-9][0-9][0-9][^0-9].*/\1/'`"
        echo "start2 is $startyear"
-       if [ `echo $startyear | wc | awk '{print $3}'` -gt 10 -o "x$startyear" 
= "x" ] ; then
+       if [ `echo "$startyear" | wc | awk '{print $3}'` -gt 10 -o 
"x$startyear" = "x" ] ; then
            startyear="`echo "$copyrightline" | sed 
's/.*[^0-9]\([0-9][0-9][0-9][0-9]\),[0-9][0-9][0-9][0-9][^0-9].*/\1/'`"
            echo "start3 is $startyear"
-           if [ `echo $startyear | wc | awk '{print $3}'` -gt 10 -o 
"x$startyear" = "x" ] ; then
+           if [ `echo "$startyear" | wc | awk '{print $3}'` -gt 10 -o 
"x$startyear" = "x" ] ; then
                startyear="`echo "$copyrightline" | sed 
's/.*[^0-9]\([0-9][0-9][0-9][0-9]\)[^0-9].*/\1/'`"
                echo "start4 is $startyear"
-               if [ `echo $startyear | wc | awk '{print $3}'` -gt 10 -o 
"x$startyear" = "x" ] ; then
+               if [ `echo "$startyear" | wc | awk '{print $3}'` -gt 10 -o 
"x$startyear" = "x" ] ; then
                    # didn't find a year, so use current year
                    startyear="$currentyear"
                fi

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to