I am accessing remote machine in Linux using Bash scripting.My code is as follows #!/bin/bash ssh -i manu_bp.pem ubuntu@54.68.67.68 <<EOF sudo -s cat /opt/revsw-config/apache/rijomon2_revsw_net/ui-config.json > r1.txt echo `$(jq .rev_component_co.mode r1.txt)` EOFI am not able to print the jq value. If I write this command as echo $(jq '.rev_component_co.mode' r1.txt) in the terminal of the remote machine, it's showing the exact result. But if I write it in a script and try to execute, it shows the errorjq: r1.txt: No such file or directory
Run a command under sudo over SSH
bash;shell script;ssh;quoting