This is not puppy related. Just a weird thing I noticed on my DIY-ed debian.
System: Debian Bullseye (installed via debootstrap).
Terminal: xterm
File Manager: pcmanfm
/usr/bin/sh: linked to bash
Experiment:
1. Open a leafpad window and leave it there;
2. Write a script: /root/xxxxxx.sh with these lines:
Code: Select all
sleep 3
if ! pgrep leafpad; then
geany
fi
3. Doubleclick /root/xxxxxx.sh to run it. Three seconds later, nothing happens, Geany does NOT open.
4. Open xterm, run this:
Code: Select all
./xxxxxx.sh & disown -h
Then quickly shut this xterm window.
Weird thing happens - three seconds later, geany opens!
(But if the xterm window is kept open till after three seconds expires, geany does not open!)
Why does the script fail to observe the if condition when the command is run from xterm and then disowned and xterm closed?