Bash meme

Published at 25, November 2008, author art. Tags: bash, fun

Today, Eric Florenzano starts a funny contests. He suggest the idea for new blogging game.

Rules are quite simple:

  1. Implement a program that takes in a user's name and their age, and prints hello to them once for every year that they have been alive.
  2. Post these rules, the source code for your solution, and the following list (with you included) on your blog.
  3. Bonus points if you implement it in a language not yet seen on the following list!

Here is my program, written in bash:

#!/bin/bash
echo -n 'Please enter your name: '
read NAME
echo -n 'Please enter your age: '
read AGE

for i in `seq $AGE`; do echo "$i) Hello, $NAME"; done

It's behaviour the same as Eric's python script. It just retrives you name and age, and then print some greetings.

I hope, together we can create a more long list, than a Hello World collection. Have a fun!

Pingbacks

permalink

18, November 2009, pingback from http://dwins.wordpress.com/2009/11/18...:

[Bash] http://aartemenko.com/texts/bash-meme/

permalink

26, November 2008, pingback from http://aartemenko.com/texts/lua-hello...:

You don't identify yourself

Comments

Subscribe on this post's comments

permalink

25, November 2008, ericflo said:

Cool! Works on my Mac :)

permalink

26, November 2008, Sapegin said:

Что-то у тебя русская локаль вылезла: «Published at вчера», «Вчера, ericflo said».

permalink

26, November 2008, art said:

Это просто джанга переводит то, для чего у нее есть переводы. А я еще не озаботился тем, чтобы вбить переводы всех строк на русский.

If you wish to leave comment, please, identify yourself and then come back to this page.