#!/bin/sh ...several lines of commands... mousepad file.txt zenity --info ...several more lines of commands... exit
Expected behavior: I command the script (in this case, via a keyboard shortcut). A Mousepad window then opens on my Xfce4 desktop, displaying the contents of file.txt. I perform some text manipulation within same and then manually close said Mousepad window. Next, the commanded Zenity window appears, as expected. I close same manually and the next step of the script executes.
The script works fine if there are no other open Mousepad windows anywhere. However, if I happen to already have one or more Mousepad windows open when I command said script (again, via a keyboard shortcut), here is what now happens:
After said script is so commanded, the expected Mousepad window (the one displaying the contents of file.txt) opens, along with the Zenity window (note that, in this case, said Zenity window opens before the Mousepad window is manually closed by me). This is undesired behavior.
Note that the subject script worked fine when running under Debian Wheezy (using SystemV). However, after a recent upgrade to Debian Jessie (using systemd) I started seeing the changed, undesired behavior. Don't know if said systemd plays into this...
I have tried many things, including the
wait command and appending the
mousepad line with
&&. I've also attempted trapping. Nothing is working for me.
What is causing this to happen and how can I remedy it?