exit

exiting script while running source scriptname over SSH

I have a script with a number of options in it one of the option sets is supposed to change the directory and then exit the script however running over ssh with the source to get it to change in the parent it exits SSH is there another way to do this so that it does not exit? my script is in the /usr/sbin directory. ...

How can I close my software in a safe way?

Up to now I used my application as a stand alone product. So, when user pressed "Stop" button I called System.exit(0); and it was fine. Now my application will be called (in a programmatic way) from another program. So, I afraid that System.exit(0); will kill not only my process but also the external software which started my program. ...

Detecting when a process has finished (but not exited)

I have a program that's run in unix (that I have no control over) that when finished prints 'Completed successfully' but does not exit. I want to automatically detect when the process finishes (by checking the output of the command), so that I can kill the process and so that I can proceed do other activities. The complexity comes becaus...

C# WebPages : manage Exit events or quit with no user action server side

Hi, What is the better solution to manage Exit or Quit events when user exit to other pages with no action?. This event need to be raised only one time and be usefull to delete all temporary files or datas not stored after the abandon of this page. Is a perfect to use as cleaning method server side. Thanks. ...

Why is the exit code 255 instead of -1 in Perl?

Why is it that when I shift the exit code, $?, in Perl by eight, I get 255 when I expect it to be -1? ...

exit from a stored procedure

i hv some loop and a condition..if codition is match then i want to stop or exit from the stored procedure..how to do that? while @@fetch_status=0 begin if x=0 'exit stored procedure end ...

How to exit current activity to homescreen (without using "Home" button)?

Hi everyone, I am sure this will have been answered but I proved unable to find it. So please excuse my redundancy. What I am trying to do is emulating the "Home" button which takes one back to Android's homescreen. So here is what causes me problems: I have 3 launcher activities. The first one (which is connected to the homescre...

How to exit mootools each()

How can I exit the each function when the conditions was true once? This does not work: $$('.box div').each(function(e) { if(e.get('html') == '') { e.set('html', 'test'); exit; } }); ...

Is there a method that tells my program to quit?

For the "q" (quit) option in my program menu, I have the following code: elif choice == "q": print() That worked all right until I put it in an infinite loop, which kept printing blank lines. Is there a method that can quit the program? Else, can you think of another solution? ...

Does control return after "execvp()" ?

if(pid == 0) { execvp(cmd, args); // printf("hello"); // apparently, putting this or not does not work. _exit(-1); } else { // parent process work } "execvp()" replaces the current program with the to-be-execed program (of course in the same process context). So, putting, say, any printf() calls after execvp() ...

Automatic exit from bash shell script on error

Hi, I've been writing some shell script and I would find it useful if there was the ability to halt the execution of said shell script if any of the commands failed. See below for an example: #!/bin/bash cd some_dir ./configure --some-flags make make install So in this case if the script can't change to the indicated dire...

call a webservice in the Application_Exit workaround issue AsyncCall

Hi, I am facing the issue in updating the Database during a browser close in the Application_Exit method. Since I cannot call a webmethod in this event to updated the DB, I'm trying for a workaround where I call another simple Silverlight Application for the sole purpose of performing the DB update. The issue is that when I make the A...

Bind command to X-button of window title bar

My WPF maintenance window have a toolbar with a button "Exit"; a CommandExit is bind with this button. The CommandExit perform some checks before exit. Now, if I click to close button of the window (x-button of title bar), this checks are ignored. How can I do to bind CommandExit to window x-button? ...

Java: How to handle a SIGTERM

No many words needed: Is there a way in Java to handle a received SIGTERM? ...

Execute a default task in ANT in case of failure

Hi, I'm currently using ANT for building my Java project on a Windows XP machine. In my build.xml file I've defined 3 task and I would like that,in case of fail,a default task be executed before closing the building and exiting (like a recovery procedure). I would like to know if it's possible. thanks ...

running php script manually and getting back to the command line?

I'm running a php script via command line, and it works just fine, except that when it's finished, it doesn't go back to the command line? Just sits there, so I never when it's done... This is the script: $conn_id = ftp_connect(REMOTE) or die("Couldn't connect to ".REMOTE); $login_result = ftp_...

how to display a text in a new view or window

thanks for ur feedback about uitext view,i am able to display text view as u told .. i dont want to allow user to edit text in it and dont want to show key board when my text view gets loaded .. another thing is i should exit or hide text view when home button pressed... thank you ,i am waiting for your valuable answer... ...

Silverlight 4: Application_Exit

How do I call a webservice in the Application_Exit event? private void Application_Exit(object sender, EventArgs e) { TestWSSoapClient.ReleaseUserCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(TestWSSoapClient_ReleaseUserCompleted); TestWSSoapClient.ReleaseUserAsync(UserToken);} The m...

Determine if a piece of code exits the program with MSVC

On a Gnu system, I can write a C macro like dies_ok() that will fork a new process, run a piece of code, after which it can write to a shared piece of memory that it didn't exit, then in the parent process I can determine if it exited or not. This is useful for tests: dies_ok({int x = 0/0;}, "can't divide by zero"); lives_ok({int x = 3/...

Add functionality to Windows.Forms exit button?

Programming in C#.NET 4.0 is my latest passion, and I would like to know how to add functionality to the standard Windows.Forms Exit button (the red X in the upper right corner of the form). I have found a way to disable the button, but since I think it compromises the user experiance, I would like to hook up some functionalities instea...