Question
help me to debug this #if binary numer is 1 then print X; Otherwise, print (space) instead convertBinaryToArt(){ binnum=$1 zero=$2 one=$3 numdigits=`expr ${binnum}` digitpos=0
help me to debug this
#if binary numer is 1 then print "X"; Otherwise, print " "(space) instead convertBinaryToArt(){ binnum=$1 zero=$2 one=$3 numdigits=`expr ${binnum}` digitpos=0 convnum="" while [ $digitpos -lt $numdigits ]; do. line 70 digit=${binnum:$digitpos:1} if [ "$digit" = "0" ]; then convnum="${convnum}$zero" else convnum="${convnum}$one" fi digitpos=`expr $digitpos +1` done echo "convnum" }
Try 'expr --help' for more information.
./new.sh: line 71: [: 0: unary operator expected
convnum
./new.sh: line 145: 01010001: command not found
expr: missing operand
Try 'expr --help' for more information.
./new.sh: line 71: [: 0: unary operator expected
convnum
./new.sh: line 145: 01010001: command not found
expr: missing operand
Try 'expr --help' for more information.
./new.sh: line 71: [: 0: unary operator expected
convnum
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started