Page 1 of 1

How to exit script after opening with "xterm -hold -e"?

Posted: Tue 30 Jun 2020, 23:15
by Semme
OK, my script suppresses everything except what I want - asking for my passphrase.

What does it need to exit after feeding it my passphrase?

Maybe this should be one of those "if" / "else" deals?

Code: Select all

#!/bin/sh
xterm -hold -e [passphrase_command]
TIA

Posted: Wed 01 Jul 2020, 02:23
by tallboy
break is used to end a loop, can it be included here?
I made a note some time ago of a link to an example that use a key input to break, see example 4 here:
https://linuxhint.com/bash_wait_keypress/
Also some reading here:
https://linuxize.com/post/bash-break-continue/

Posted: Wed 01 Jul 2020, 09:44
by Semme
Olaf, thanks. Offhand I wasn't familiar with those methods.

Turns out all it took to get the desired result was to relocate my "hold" argument.

Posted: Wed 01 Jul 2020, 16:02
by tallboy
It usually ends good, after some brainwork! :D
BTW; the Xterm man page is so massive, that you have to read it a few times to take it all in! Good work!

Posted: Thu 02 Jul 2020, 00:02
by MochiMoppel
tallboy wrote:BTW; the Xterm man page is so massive, that you have to read it a few times to take it all in! Good work!
Read what for? Which Puppy contains xterm?

Posted: Thu 02 Jul 2020, 03:49
by wiak
MochiMoppel wrote:
tallboy wrote:BTW; the Xterm man page is so massive, that you have to read it a few times to take it all in! Good work!
Read what for? Which Puppy contains xterm?
The original post did not say it was for any (or any pristine) Puppy.

Posted: Thu 02 Jul 2020, 05:28
by tallboy
MochiMoppel, the first uncommented word in the script is xterm.
The options:
-hold
Turn on the hold resource, i.e., xterm will not immediately destroy its window when the shell command completes. It will wait until you use the window manager to destroy/kill the window, or if you use the menu entries that send a signal, e.g., HUP or KILL.
-e program [ arguments ... ]
This option specifies the program (and its command line arguments) to be run in the xterm window. It also sets the window title and icon name to be the basename of the program being executed if neither -T nor -n are given on the command line. This must be the last option on the command line.
I used xterm for several years, at the uni where RedHat Enterprise was the distro in use.

Posted: Thu 02 Jul 2020, 06:46
by MochiMoppel
tallboy wrote:MochiMoppel, the first uncommented word in the script is xterm.
What you see is not always what you get.

My point is that in most Puppies xterm is the name of an odd script, that - when you use the -hold option - creates another script that eventually passes all arguments to urxvt. This seemingly obsolete script is still part of woofCE where someone in 2017 even took the trouble to make minor changes. No comments as to why the changes were made or why this script is still useful. In Bionicpup64 xterm is a simple symlink to urxvt.

I have never seen a genuine xterm in any Puppy, and if someone sees a need to compile and install the real thing I would be interested to know why. Maybe there are useful gems in there that are worth to be discovered.

Posted: Thu 02 Jul 2020, 16:46
by tallboy
I have tried other terminal emulators, but I prefer the urxvt myself. Xterm had it's limitations.
MochiMoppel wrote:Maybe there are useful gems in there that are worth to be discovered.
No. :lol: