4

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

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

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

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

is not delivering me the result. The terminal opens up as expected, however on entering the password the terminal closes abruptly.
It also works fine if I use static argument as in

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


It is a command that will never exit, it will execute for infinity.

2
  • Where are you adding that shortcut? How is it set up exactly? Is that command supposed to stay running until you kill it? Nov 23, 2015 at 14:16
  • 1
    Here my arpspoof is a command that will never exit, I have edited my question accordingly.
    – Sunny
    Nov 23, 2015 at 15:21

0

Browse other questions tagged or ask your own question.