Skip to main content
added 44 characters in body
Source Link
Anthon
  • 81.4k
  • 42
  • 174
  • 228

I (nearly) always quote everything to "echo", so I would do the above like:

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

As it standsThe difference with @muru solution is, that there the original echo command is run "in the background" - here it's echoing to the screen in the foreground, but run as a background command. (It@muru's also doesn't show the ampersand at the end of the command.)

I (nearly) always quote everything to "echo", so I would do the above like:

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

As it stands, the original echo command is run "in the background" - it's echoing to the screen in the foreground, but run as a background command. (It also doesn't show the ampersand at the end of the command.)

I (nearly) always quote everything to "echo", so I would do the above like:

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

The difference with @muru solution is, that there the original echo command is run "in the background" - here it's echoing to the screen in the foreground, but run as a background command. (@muru's also doesn't show the ampersand at the end of the command.)

Source Link

I (nearly) always quote everything to "echo", so I would do the above like:

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

As it stands, the original echo command is run "in the background" - it's echoing to the screen in the foreground, but run as a background command. (It also doesn't show the ampersand at the end of the command.)