Bourn script on solaris 9

Hello Everyone

I need a bourn script that allow the users to enter any network address from (172.21.2.1 - 172.21.2.24) .
more explanation :
the script should add entries (ip address&hostname) to the hosts file , so i can ping to another computer using the hostname .
the host file will be like this after execution the script :
172.21.2.1 sh1
172.21.2.2 sh2
............... ....
172.21.2.24 sh24

Note : I must use the loop process to creat this list .

I hope everyone help me

thank you all

This sounds an awful lot like homework, since it's only a loop and an echo.

I know it is easy for you, but I don't know how to do it
can you help me please

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.