Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. #! /bin/bash
  2. if [ $# != 1 ] ; then
  3. echo wrong arg,please input one arg
  4. exit 1;
  5. fi
  6.  
  7. if grep '^[[:digit:]]*$' <<< "$1";then
  8. echo "$1 is number."
  9. else
  10. echo "$1 is not number."
  11. fi
  12.  
  13. if [ $1 -eq 1 ] ; then
  14. echo
  15. '
  16. /___/
  17. /
  18. | # # |
  19. @ |
  20. _|_ /
  21. / ______
  22. / _______ ___
  23. |_____ __/
  24. | __/
  25. | |
  26. /
  27. / ____
  28. | / |
  29. | | | |
  30. / | |
  31. __/ __/
  32. '
  33. elif [ $1 -gt 1 ] ; then
  34. echo
  35. '
  36. /___/
  37. /
  38. | # # |
  39. @ |
  40. _|_ /
  41. / ______
  42. / _______ ___
  43. |_____ __/
  44. | __/
  45. '
  46. i=1;
  47. while [ $i -le $1 ]
  48. do
  49. echo ' | |'
  50. i=`expr $i + 1`
  51. done
  52. echo ' /
  53. / ____
  54. | / |
  55. | | | |
  56. / | |
  57. __/ __/
  58. '
  59. else
  60. echo wrong number,please input the right one
  61. exit 1;
  62. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement