0

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 search.sh). What am I doing wrong?

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

2 Answers 2

3

You're using the wrong command.

echo "grep --ignore-case $1 *.find" > search.sh
1
  • 1
    Quotes should be single?..
    – brownian
    Mar 20, 2012 at 8:27
2

Use echo instead of cat.

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

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .