I want automatize these commands:
qemu-arm -g 12358 exec &
gdb-multiarch -q --nh -ex 'set architecture arm' -ex 'file exec' -ex 'target remote localhost: 12358'
if I try to create this script
#!/bin/bash
read VAR1
qemu-arm -g "$VAR1" exec &
gdb-multiarch -q --nh -ex 'set architecture arm' -ex 'file exec' -ex 'target remote localhost: "$VAR1"'
it doesn't works and I get this output
The target architecture is assumed to be arm
Reading symbols from exec...
localhost: "$VAR1": cannot resolve name: Servname not supported for ai_socktype
localhost: "$VAR1": No such file or directory.
I'm not a expert about bash script but i think the problem is about " " of second VAR1, there is a way for fix it?