Skip to content

Instantly share code, notes, and snippets.

@kunthar
Created September 25, 2019 10:01
Show Gist options
  • Select an option

  • Save kunthar/e80f72498a808dd0da82e0500b718c5f to your computer and use it in GitHub Desktop.

Select an option

Save kunthar/e80f72498a808dd0da82e0500b718c5f to your computer and use it in GitHub Desktop.
find error(s) in this bash script
#!/bin/bash
MAX_NO=0
echo -n "Enter Number between (6 to 11) : "
read MAX_NO
if ! [ $MAX_NO -ge 6 -a $MAX_NO -le 11 ] ; then
echo "You should give number between 6 and 11."
exit 1
fi
clear
for (( i=1; i<=MAX_NO; i++ )) do for (( s=MAX_NO; s>=i; s-- ))
do
echo -n " "
done
for (( j=1; j<=i; j++ )) do echo -n " ." done echo "" done ###### Second stage ######################
for (( i=MAX_NO; i>=1; i-- ))
do
for (( s=i; s<=MAX_NO; s++ ))
do
echo -n " "
done
for (( j=1; j<=i; j++ ))
do
echo -n " ."
done
echo ""
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment