LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 06-29-2008, 12:02 PM   #1
OldGaf
Member
 
Registered: Feb 2008
Posts: 47

Rep: Reputation: 15
BASH - How to open an interactive script from a non interactive script.....


Hi, thanks for reading my thread!

I have a script that I run by clicking an icon on my desktop.
The script goes and checks my various email accounts and a voice tells me how many (if any) emails there are for each account.

This is done non interactively.

I then expanded on that to have it ask me if I want it to continue. If I choose yes, it calls another script that tells me who they are from and the subject (later I will add a prompt to read the body).

My problem is I need a way to tell it to continue.

I can have it open a console while the scripts are running, but would rather have it all run in the background.

I would "settle" for it opening a console when asking a question, then closing the console and continuing. Thats what I am playing with now.

I read that if you put -i in the header (#!/bin/bash -i), it will make a script run interactively...... this does not work for me. I tried having the 1st script call the "question" script (which had the -i), no good. I then tried a trap thinking that the first script had to be truly "dead" before the -i script would work.. (trap ./question 0).... this also did not work.

So.... the questions:

1) Is there a way I can send a non interactive script simple input? - (doubtful)

2) How can I make a non interactive script call an interactive one and vis versa?

thanks,
-OG-

Last edited by OldGaf; 06-29-2008 at 12:03 PM. Reason: tags
 
Old 06-29-2008, 01:21 PM   #2
OldGaf
Member
 
Registered: Feb 2008
Posts: 47

Original Poster
Rep: Reputation: 15
Partial fix...

OK, I can use "xterm -e ./question" to run the question script...
How do I get it to exit and run another script in the background again?
 
Old 06-29-2008, 01:43 PM   #3
OldGaf
Member
 
Registered: Feb 2008
Posts: 47

Original Poster
Rep: Reputation: 15
Sorry.... to clairify, I don't mean "./script3 &" .... if I do that the script runs, but I don't here it.
 
Old 06-29-2008, 02:13 PM   #4
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 59
Use something like zenity to present a GUI dialog. Use its exit status to indicate how your script should continue.
 
Old 06-29-2008, 04:34 PM   #5
OldGaf
Member
 
Registered: Feb 2008
Posts: 47

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Mr. C. View Post
Use something like zenity to present a GUI dialog. Use its exit status to indicate how your script should continue.
Excellent idea..... I should have thought of that myself! Already running KDE so will use kdialog.

Thanks a bunch!
 
  


Reply

Tags
bash, call, exit, interactive, trap


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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
shell script in non interactive way googlix Linux - General 6 11-13-2007 09:18 AM
Making an init script interactive valcaro Suse/Novell 1 04-27-2007 03:05 PM
Is it possible to capture the output of a interactive script? Akhran Linux - Newbie 4 04-11-2007 09:28 PM
bash script works when interactive, endless loop when started via cron dguy Linux - General 5 04-10-2006 11:39 AM
Please help with interactive script moosedaddy Linux - Newbie 3 12-08-2005 09:02 PM


All times are GMT -5. The time now is 10:08 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