Read no longer pauses bash script when using a program launcher

Upgrading Linux Mint to Version 19.1 (Tessa) seems to have broken the ability of a read command at the end of a bash script to pause the script so leaving the terminal window open. Such scripts work correctly when run directly in a terminal window, or by double-clicking on the script file from the file manager, but they fail to pause when run through a program launcher.

The script in question is used to safely eject USB drive (see Safely removing a USB drive with a bash script).

The fix (or at least a workaround) is provided in a post by Karsvo on the Ask Ubuntu forum. His technique is to use the following command in the program launcher:

gnome-terminal -e "bash -c ~/EjectUSB.sh; bash"

References:

Safely removing a USB drive with a bash script
https://linuxnorth.wordpress.com/2018/01/25/safely-removing-a-usb-drive-with-a-bash-script/

Safely removing a USB flash drive
https://linuxnorth.wordpress.com/2017/07/04/safely-removing-a-usb-flash-drive/

How to run a script without closing the terminal?
https://askubuntu.com/questions/20330/how-to-run-a-script-without-closing-the-terminal

Mint 19.1: Bash scripts no longer work from desktop launcher
https://www.linuxquestions.org/questions/showthread.php?p=5941854#post5941854

Advertisements
This entry was posted in Bash script, Mint and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s