Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Communications and Networking

Authors: Behrouz A. Forouzan

5th edition

73376221, 978-0073376226

More Books

Students also viewed these Computer Network questions