Skip to main content
3 of 4
added 6 characters in body
muru
  • 77.9k
  • 16
  • 212
  • 318

Double quotes in bash

I am trying to create a bash file which calls a program that expects a parameter to submitted between two double quotes.

Take a look at my file content.

#!/bin/bash
echo ./yowsup/yowsup-cli demos --s $1 \"$2\" -c yowsup/config &
./yowsup/yowsup-cli demos --s $1 \"$2\" -c yowsup/config &

The echo part prints exactly the command I need, but when I comes to execute it (next line), I am messing it up.

How can I get this fixed?

Thanks!

This is how I need to call it:

./yowsup/yowsup-cli demos --s 9999999999 "my parameter" -c yowsup/config

Echo result:

./yowsup/yowsup-cli demos --s 9999999999 "my parameter" -c yowsup/config

Call result:

demos: error: unrecognized arguments: parameter

Copying and pasting echo results:

INFO:yowsup.demos.sendclient.layer:Message sent
user101903