I am writing a simple shell script that fetches output from one command uses it in another.
app=$(./twiddle.sh -u $1 -p $2 query jboss.web.deployment:* | grep $3)
doop=$(./twiddle.sh -u $1 -p $2 invoke jboss.system:MainDeployer $4 $app)
++ ./twiddle.sh -u admin -p password invoke jboss.system:MainDeployer stop $'jboss.web.deployment:war=worker.war,id=1518231766\r'
I see in the above commands that the app is coming of value:
$'jboss.web.deployment:war=worker.war,id=1518231766\r'
But if I do echo $app then I am not seeing the quotes and \r appended, How can I ensure app is sent without quotes as an input to another command?. I am not sure where the problem is - I cannot see this as the output when I execute the commands outside of shell.
Thanks for any help.