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

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
User avatar
Semme
Posts: 8399
Joined: Sun 07 Aug 2011, 20:07
Location: World_Hub

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

#1 Post 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
Last edited by Semme on Wed 01 Jul 2020, 09:40, edited 1 time in total.

User avatar
tallboy
Posts: 1760
Joined: Tue 21 Sep 2010, 21:56
Location: Drøbak, Norway

#2 Post 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/
True freedom is a live Puppy on a multisession CD/DVD.

User avatar
Semme
Posts: 8399
Joined: Sun 07 Aug 2011, 20:07
Location: World_Hub

#3 Post 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.
>>> Living with the immediacy of death helps you sort out your priorities. It helps you live a life less trivial <<<

User avatar
tallboy
Posts: 1760
Joined: Tue 21 Sep 2010, 21:56
Location: Drøbak, Norway

#4 Post 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!
True freedom is a live Puppy on a multisession CD/DVD.

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#5 Post 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?

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

#6 Post 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.

User avatar
tallboy
Posts: 1760
Joined: Tue 21 Sep 2010, 21:56
Location: Drøbak, Norway

#7 Post 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.
True freedom is a live Puppy on a multisession CD/DVD.

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#8 Post 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.

User avatar
tallboy
Posts: 1760
Joined: Tue 21 Sep 2010, 21:56
Location: Drøbak, Norway

#9 Post 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:
True freedom is a live Puppy on a multisession CD/DVD.

Post Reply