Bash scripting

Try to imagine a flag:
nnnnx
nnnxx
nnxxx
nxxxx

now imagine how it will output:
4 times the "n"and 1 times "x"
3 times "n"and" 2 times" x "
.. etc. ..

rhombus is the same only instead of "n" is there
gap "and " x "is a few times to form the correct shape

Can you help how write it please??

homework?

Little yes, but i am beginner and i want learn how to it...
I have this:
a=1
b=1

while [ $b -lt 8 ]; do
echo -n "H"
b=$((b+1))
done
echo ""

while [ $a -lt 8 ]; do
echo -n "X"
a=$(( a+1 ))
done
echo ""

I dont know how to it:(

---------- Post updated at 07:43 AM ---------- Previous update was at 07:38 AM ----------

I need help please :slight_smile:

Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.

Thank You.

The UNIX and Linux Forums.