Answered step by step
Verified Expert Solution
Question
1 Approved Answer
How to write a bash shell script that prints a hollow box after user enters number of lines, ie bash hbox 4 , prints: ****
How to write a bash shell script that prints a hollow box after user enters number of lines, ie "bash hbox 4" , prints:
**** * * * * ****
My code doesnt work. i need it to take in the argument from the command line: ./hbox 4 "*"
echo "Enter number of rows" read sz
clear
for (( x = 1; x <= $sz; x++ )); do for (( y = 1; y <= $sz; y++ )); do if [ "$x" == 1 ] || [ "$x" == "$sz" ] || [ "$y" == 1 ] || [ "$y" == "$sz" ] then echo "* " else echo " " fi done echo -ne "" done
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