I'm searching for a string, and then trying to get the answers to print. My script looks like this echo "\tPlease enter the battery number you wish to search for..."
+4 read ans
+5
+6 if [[ $ans != 0 ]]
+7
+8 then
+9 cat /dso/eis/log/batlog.log.* |grep $ans
+10 fi
+11
+12 echo "\tWould you like to print this? (y/n)"
+13 read ans1
+14
+15 if [[ $ans1 = y -o Y ]]
+16
+17 then
+18 lp -dpcl@pr7
+19
+20 fi
Line 15 is coming back with an error. Saying -o is unexpected. What am I doing wrong?
+4 read ans
+5
+6 if [[ $ans != 0 ]]
+7
+8 then
+9 cat /dso/eis/log/batlog.log.* |grep $ans
+10 fi
+11
+12 echo "\tWould you like to print this? (y/n)"
+13 read ans1
+14
+15 if [[ $ans1 = y -o Y ]]
+16
+17 then
+18 lp -dpcl@pr7
+19
+20 fi
Line 15 is coming back with an error. Saying -o is unexpected. What am I doing wrong?