LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 01-18-2008, 08:17 PM   #1
geeyathink
Member
 
Registered: Apr 2006
Distribution: Mandy 2007, Kubuntu
Posts: 56

Rep: Reputation: 15
dialog in the middle of a command


I am trying to learn a little more about writing bash scripts. .

I found how to use a dialog (kdialog) with a script by just invoking it or by using an if/then with the exit status of a command. But I have not found how to open a dialog that would be needed in the middle of a running command.

For instance running cp from a command line prompts me if "a file by the same name exists - overwrite?" of course the exit status is 0 no matter the choice of yes or no. (providing no other problems come up at the moment)

I have most likley looked at the answer in my searches but just did not understand.

The only thing I can think of myself (trying to use that tiny little brain again - almost never works )is to change the options to cp so that it exits when a file of the same name exists, use that exit status to open a dialog. Then use the exit status of that dialog to open a new instance of cp that has different options set depending on the exit status of the dialog.

Just a (strong) hint about what to look into to do what I am after would be great.

Thank you.
 
Old 01-18-2008, 08:32 PM   #2
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,821

Rep: Reputation: 121Reputation: 121
I woluld not rely on the error from cp, but test for the condition of a file existing at the destination before attempting the copy.
 
Old 01-18-2008, 10:25 PM   #3
geeyathink
Member
 
Registered: Apr 2006
Distribution: Mandy 2007, Kubuntu
Posts: 56

Original Poster
Rep: Reputation: 15
Thanks crabboy, makes sense.
I guess I was thinking that because cp already knows to ask the question there would be something built in for dialog to pick up on and pass along.



easylaterT
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
dialog: command not found adamdyer Linux - Newbie 1 08-11-2005 03:00 PM
Dialog command not recognized on debian sarge's bash!!! CM019 Linux - Newbie 2 02-13-2005 03:37 PM
Middle Mouse darkjedi8359 Mandriva 2 01-19-2005 02:05 AM
Middle Clicking TMH Linux - Hardware 1 12-14-2004 02:03 PM
List partiton with dialog command zael Programming 0 04-02-2004 02:55 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:19 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration