LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 09-08-2004, 09:34 AM   #1
TheSpork
Member
 
Registered: May 2003
Location: Norway
Distribution: Ubuntu / Debian
Posts: 40

Rep: Reputation: 15
How to make a shell stay open?


I'm messing around with my "menu"-file in Fluxbox, but there's one thing I just can't get working.

The problem is that I'm trying to make a "link" in my menu to a command that opens a shell, shows output from a command, and then stays open until I close it. I've got some dependency problems (crash between some programs) so I can't install xterm (I think there's an option called '-hold' to xterm?!)

I use Eterm, but open for suggestions (not xterm as explained earlier), and I've tried with sleep functions, and a script similar to this:

Code:
#!/bin/bash
gnomesu "iwlist ath0 accesspoints"
echo "Press enter..."
read ans
but without any success.. The window still closes before I can see the output..

Does anyone have any idea how to get this working?
 
Old 09-08-2004, 10:47 AM   #2
Andrew Benton
Senior Member
 
Registered: Aug 2003
Location: Birkenhead/Britain
Distribution: Linux From Scratch
Posts: 2,073

Rep: Reputation: 64
How do you mean, you "can't install xterm"? Isn't it built into X windows? Aren't other shells just a different skin on an xterm?
 
Old 09-08-2004, 12:06 PM   #3
scissors
Member
 
Registered: Aug 2004
Location: Seattle
Distribution: Red Hat es and as, Solaris, Fedora, Debian, Tru64
Posts: 45

Rep: Reputation: 15
I don't know how to with bash, but you can throw some perl in:

Code:
#!/usr/bin/bash
 
xterm -e "perl -e 'while (<>){}'"
I assume that eterm has an -e switch.
 
Old 09-08-2004, 12:26 PM   #4
TheSpork
Member
 
Registered: May 2003
Location: Norway
Distribution: Ubuntu / Debian
Posts: 40

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by scissors

Code:
#!/usr/bin/bash
 
xterm -e "perl -e 'while (<>){}'"
To be honest, I've never programmed any perl.. So.. Where do you insert the command?

I tried between the { & }, but it just failed.. That was the most natural place for me and my knowledge!

And to Andrew.. xterm is just one of several terminals.. I'm using Eterm for stuff like this, because it's way more configurable. xterm have some dependency problems with a couple other packages I've got installed, so I tend to use Eterm..
 
Old 09-08-2004, 12:55 PM   #5
scissors
Member
 
Registered: Aug 2004
Location: Seattle
Distribution: Red Hat es and as, Solaris, Fedora, Debian, Tru64
Posts: 45

Rep: Reputation: 15
Using your initial example, I would do this:

Code:
#!/bin/bash
eterm -e "gnomesu 'iwlist ath0 accesspoints'; echo 'Press Ctrl+C...'; perl -e 'while (<>){}'"
Again, assuming that eterm has an -e switch, this says "open a new eterm window and execute gnome su, then when you are done with that echo "Press Ctrl+C...", and finally execute an infinite loop in perl so the window will stay open until someone hits Ctrl+C.
 
Old 09-08-2004, 01:30 PM   #6
TheSpork
Member
 
Registered: May 2003
Location: Norway
Distribution: Ubuntu / Debian
Posts: 40

Original Poster
Rep: Reputation: 15
[QUOTE]Originally posted by scissors
[B]Using your initial example, I would do this:

Code:
#!/bin/bash
eterm -e "gnomesu 'iwlist ath0 accesspoints'; echo 'Press Ctrl+C...'; perl -e 'while (<>){}'"
Still I have the same problem. As soon as "gnomesu -c iwlist ath0 accesspoints" finishes, the terminal window closes down.. If I run the script from another shell, "Press Ctrl+C..." shows up in the shell I run the script from after the one I want closes..

I didn't know it was this hard! :/ Thanks for the suggestion anyways!!
 
Old 09-08-2004, 09:07 PM   #7
CroMagnon
Member
 
Registered: Sep 2004
Location: New Zealand
Distribution: Debian
Posts: 900

Rep: Reputation: 33
I will install eterm and try later tonight, but have you tried the suspend command?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
make hsfconfig stay crkoa Slackware 2 11-19-2005 06:22 PM
how could i make a user stay in his or home dir Paxmaster Linux - General 1 03-23-2005 09:10 PM
Djvu wont stay Open hhegab Linux - Software 0 05-29-2004 08:13 AM
gkrellm without having Konsole stay open? /home/kyle Linux - Software 6 03-12-2004 02:05 PM
How to make modules to stay in the memory till syst shutdown?? paonethestar Linux - Software 2 10-29-2003 09:31 AM


All times are GMT -5. The time now is 10:44 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration