Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
Pages: (2) </ [1] 2 >/

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: Aghhh! Keeping shell window open after menu launch, Going stark raving mad< Next Oldest | Next Newest >
WoofyDugfock Offline





Group: Members
Posts: 146
Joined: Sep. 2004
Posted: Oct. 11 2004,13:04 QUOTE

How do you keep a window open after running an executable?

Having conquered editing my fluxbox menus to add apps installed via synaptic, I thought it might be pleasant to be able to launch the command-line prog 'wipe' (say with the help info) from the right-click menu. This is a secure file deletion utility from apt-get and runs just dandy from a shell.

Now I've tried a hundred things - all of them open a window for a picosecond before closing, presumably running wipe for that picosecond. For eg:

[exec] (Wipe) {rxvt -rv -fn fixed -T "Wipe" -e /usr/bin/wipe -h}
# this is in imitation of the bashburn line

I've also tried calling Xterm instead which is supposed to have a -hold option to keep a window open after executing according to man - this don't work. But then dsl doesn't have  he full version of this, does it?

I've tried  a lot of googling without success - too many dead-ends to remember.

Agghhhhhhh!!!!


--------------
"We don't need no stinkin' Windows"

http://news.zdnet.co.uk/software/linuxunix/0,39020390,39149796,00.htm
Back to top
Profile PM 
mikshaw Offline





Group: Members
Posts: 4856
Joined: July 2004
Posted: Oct. 12 2004,02:42 QUOTE

I think the xterm in DSL is still rxvt, so xterm options which aren't available in rxvt probably won't work.
Personally I just open a terminal and type the command if I want the term to remain open....it's really pretty easy =o)


--------------
http://www.tldp.org/LDP/intro-linux/html/index.html
Back to top
Profile PM WEB 
WoofyDugfock Offline





Group: Members
Posts: 146
Joined: Sep. 2004
Posted: Oct. 12 2004,05:37 QUOTE

Thanks for info about rxvt. Granted, just opening a shell and typing in a shell is easy enough.  But I suppose it's become more the principle of the thing now! (I'm nothing if not stubborn).

I mean, the bashburn line I quoted above does it for bashburn using rxvt, so it must be possible. But exactly the same syntax doesn't work for another command line executable!

I noticed while I was googling that someone had had exactly the same question on a forum for some type of CLI nix implementation on MacOSX.  There it had been solved two ways but the best was by running a simple sh script foo.sh from the line in the desktop menu prefs which opened a window and then executed whatever argument(s) followed the script using {*}. The window then wouldn't close until you did something in it. But I copied both methods and tried and they didn't work - either under sh or bash - but maybe different syntax. I've had trouble finding it again but I'll have another look.

Any 'nix 'perts out there?


--------------
"We don't need no stinkin' Windows"

http://news.zdnet.co.uk/software/linuxunix/0,39020390,39149796,00.htm
Back to top
Profile PM 
WoofyDugfock
Unregistered






Posted: Oct. 12 2004,14:30 QUOTE

Well I've found a brute force solution of sorts mainly by very much trial and error however I doubt it's the best one. (Coders avert thy gaze).

I wrote a little script opt/burble.sh which diplays the wipe help file and then calls the bash shell in an infinite (?) loop so the !@#^^&&**
bastard can't close. Bend to my will or run forever .. So at least using the fluxbox menu to access wipe throws up the help file to read and keeps a shell open:

#!/bin/sh
/usr/bin/wipe -h
while true
do
/bin/bash
done

In /home/dsl/.fluxbox/menu I then put:

[exec] (Wipe) {sudo rxvt -rv -fn fixed -T "Wipe" -e /opt/./burble.sh}

I thought you'd be horrified! You can't quit the shell by typing exit but the window can be closed by clicking the X.
Of course, I wonder if the loop is still running underneath in which case it needs an improvement to shut that off!??

I tried experimenting with "wait" but to no avail.

I gather that the actual problem is that wipe is running as a child of rxvt parent and the parent terminates when the child does, or something.
However I don't know
enough (anything) about process management in linux to fix this, 'fork()' and such.

Takers?
Back to top
clacker Offline





Group: Members
Posts: 570
Joined: June 2004
Posted: Oct. 12 2004,17:23 QUOTE

I'm more a giver than a taker.

woofy, have you tried sleep?  I find that sleep can be a useful thing sometimes.  As in sleep 15 at the end of a script to keep the window open.

An even better solution is to use a line like this:

[exec] (Wipe) {rxvt -rv -T "Wipe" -e /bin/bash --init-file /opt/.../burble}

and put your commands in the burble file.  That uses burble as a start up script for bash.  When that's done, you're in a bash shell.  Do only that and you're OK, but I added the PS1 line to match the prompt to the default one.  My burble would look like this:

PS1='\u@\h:\w\$ '
/usr/bin/wipe -h
Back to top
Profile PM 
5 replies since Oct. 11 2004,13:04 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

Pages: (2) </ [1] 2 >/
reply to topic new topic new poll
Quick Reply: Aghhh! Keeping shell window open after menu launch

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code