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

My bash script does many things, among which creating another script. I would like to have the following line to be executed from within a script. But it does not work (grep is executed instead of pasted in What am I doing wrong?

cat "grep --ignore-case $1 *.find" >

share|improve this question
up vote 3 down vote accepted

You're using the wrong command.

echo "grep --ignore-case $1 *.find" >
share|improve this answer
Quotes should be single?.. – brownian Mar 20 '12 at 8:27

Use echo instead of cat.

And because you use wildcards, maybe you want to use »'«, not »"«:

echo 'grep --ignore-case $1 *.find' >>

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.