Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /bin/bash
- fun()
- {
- echo enter a number:
- read n
- for (( i=1; i<=n; i++ ))
- do
- for (( j=i; j>=1; j-- ))
- do
- echo -n "$i "
- done
- echo
- done
- control
- }
- control()
- {
- echo "Do you want to run again(yes/no)?"
- read a
- case $a in
- yes )
- fun ;;
- no )
- exit ;;
- * )
- echo "invaild input" ;;
- esac
- }
- fun
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement