0

How can I create an icon on desktop in Ubuntu 20.04, which open Terminal and write out NordVPN status in Terminal. Command is "nordvpn status". I have .sh file, but when open Terminal, immediately close and I cann't read the result.

#!/bin/bash
gnome-terminal -e nordvpn status
0

1 Answer 1

2

the simplest method would be to wait for a keypress at the end of your script. For example:

#!/bin/bash
# gnome-terminal -e nordvpn status
nordvpn status
read -n1 -p "Press any key..."
2
  • This won't work. the gnome-terminal -e nordvpn status opens a new terminal which closes immidiately after the command nordvpn status, while the parent terminal stays open and waits to read x. One solution is to get rid of the gnome-terminal -e part. So that all the commands are executed in the same terminal.
    – user68186
    Feb 18, 2022 at 17:06
  • user68186 is right: I am editing the answer.
    – Macsek
    Feb 18, 2022 at 17:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .