Keyboard shortcut with idle gnome terminal

I want to execute a command from a terminal that uses the output of another command as an argument, so I used the $ operator, as in

sudo arpspoof -i wlan0 $(/sbin/ip route | awk '/default/ { print $3 }')

The above command works fine if I execute it from the terminal, However, I want to run the same command as the keyboard shortcut when adding a keyboard shortcut with the command

gnome-terminal -e "sudo arpspoof -i wlan0 $(/sbin/ip route | awk '/default/ { print $3 }')"

doesn't give me a result. The terminal opens as expected, but when you enter the password, the terminal closes abruptly.
It also works fine if I use a static argument, as in

gnome-terminal -e "sudo arpspoof -i wlan0 192.168.0.1"


This is a team that will never come out, it will be executed for infinity.

+4

Source: https://habr.com/ru/post/1617071/


All Articles