Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

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

1 Answer 1

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.