Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

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 read the use of here document. I tried something like this:

echo $* <<End  

What I'm trying here is, when I run this script rather than taking input from command line, I'm asking it to take it as anto. But this doesn't working for me.

I'm very new to bash scripting. Can anyone say, where I'm making the mistake?

Thanks in advance.

share|improve this question
up vote 2 down vote accepted

echo doesn't read any information from stdin so you can't use a here-doc with it.

Use cat instead, like

share|improve this answer

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.