Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need help with writing this shell script. Could someone please help me. Thanks.

Write a shell script my_echo that accepts an arbitrary number of arguments and prints them, one per line, adding text "(this is an integer)" after each argument, which is an integer.

share|improve this question
Sounds like a homework – Gilles Quenot Feb 22 '13 at 13:15

use this

save this to

#!/usr/bin/env bash
a=$[$a + $text]
b=$[$b + $text]
c=$[$c + $text]
echo "$a"
echo "$b"
echo "$c"

then chmod 777

then run ./ 2 4 6

share|improve this answer
No No no NO! chmod 777 is NEVER acceptable. – Hennes Dec 23 '13 at 15:31
Apart from that, this doesn't do what the OP needs – slhck Dec 23 '13 at 15:36
I did not even check that after I saw the failed #, the direct path to a potential bash location and the code which seemed very inflexible. I would expect something with shift registers. – Hennes Dec 23 '13 at 17:49
Then give chmod u+x because you only run the program. Or try simply as sh 2 4 6 – mailer Dec 24 '13 at 2:29

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.