By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,796 Members | 1,168 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,796 IT Pros & Developers. It's quick & easy.

Hello World Day

Nepomuk
Expert 2.5K+
P: 3,112
Hi everybody!
As was suggested here, today should be Hello World Day! So, here's my Hello World Program in bash script:
Expand|Select|Wrap|Line Numbers
  1. #!/bin/bash
  2. i=0;
  3. function hello {
  4.     case $i in
  5.     0)
  6.         echo 'H'
  7.         i=`expr $i + 1`;
  8.         hello
  9.         ;;
  10.     1)
  11.         echo 'e'
  12.         i=`expr $i + 1`;
  13.         hello
  14.         ;;
  15.     2)
  16.         echo 'l'
  17.         i=`expr $i + 1`;
  18.         hello
  19.         ;;
  20.     3)
  21.         echo 'l'
  22.         i=`expr $i + 1`;
  23.         hello
  24.         ;;
  25.     4)
  26.         echo 'o'
  27.         i=`expr $i + 1`;
  28.         hello
  29.         ;;
  30.     5)
  31.         echo ' '
  32.         i=`expr $i + 1`;
  33.         hello
  34.         ;;
  35.     6)
  36.         echo 'W'
  37.         i=`expr $i + 1`;
  38.         hello
  39.         ;;
  40.     7)
  41.         echo 'o'
  42.         i=`expr $i + 1`;
  43.         hello
  44.         ;;
  45.     8)
  46.         echo 'r'
  47.         i=`expr $i + 1`;
  48.         hello
  49.         ;;
  50.     9)
  51.         echo 'l'
  52.         i=`expr $i + 1`;
  53.         hello
  54.         ;;
  55.     10)
  56.         echo 'd'
  57.         i=`expr $i + 1`;
  58.         hello
  59.         ;;
  60.     11)
  61.         echo '!'
  62.         ;;
  63.     esac
  64. }
  65.  
  66. hello
Greetings,
Nepomuk

PS.: This Thread will be unstuck tomorrow, so don't worry dear fellow mods.
Nov 21 '08 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.