I have a shell script
#! /bin/bash
command='echo "hello world" '
timeout=10
cli_raw_output="$(timeout ${timeout} "${command}" 2>&1)"
echo "$cli_raw_output"
Here when I execute, it's giving the error as
timeout: failed to run command `echo "hello world" ': No such file or directory
I understand that it's treating 'echo "hello world"' as a single word. But in these cases how do I execute it?
I can't remove the quotes around 'command' variable as I have to treat 'hello world'(it's a requirement) as a single word(not necessary in this echo case though).