Sponsored Content
Top Forums Shell Programming and Scripting Problem in checking file abort Post 302186240 by Smiling Dragon on Wednesday 16th of April 2008 08:42:09 PM
Old 04-16-2008
Quote:
Originally Posted by ahjiefreak
Hi,

I would like to know given executing a file with inputs, I would like to know when does it terminate /abort abnormally.

I tried to append an echo $? after executing my program which is in C. However, there is nothing..It shows 0 even though the program actually exit.

my command is something like
Code:
a.exe 4 4 4 < 3 3 3 | echo $?

Please advise. Thanks.
Your example runs the echo command and a.exe at the same time and redirects the output from one to another, you want to run a.exe then (once it finishes running) ask the shell for the exit code.
Try:
Code:
a.exe 4 4 4 < 3 3 3 ; echo $?

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Error Checking Problem

Here is my problem I'm designing a script that will have to accept user input from the command line using the read command. The problem is that I have to check the input which should be in the format of <first name> <last name> <phone number (8 digits long)> The input can also be ... (4 Replies)
Discussion started by: pokeycam
4 Replies

2. UNIX for Advanced & Expert Users

examine core file after abort()

I'm running Red Hat Linux 2.6.7 on a x86_64 box. I have a core file from a program that called abort(). Does anyone here know how can I get a backtrace? (Re-creating the error with svd running inside gdb has proved impossible). % gdb svd core.25223 GNU gdb Red Hat Linux... (2 Replies)
Discussion started by: svact
2 Replies

3. UNIX for Dummies Questions & Answers

Problem in checking space of mount.Please help me

Hi everyone, I am writing a script. As a part of this script, I wanted to check the space of few mounts, If the space usage percentage of the mount crosses over a certain limit then i wanted to display a warning message. The following is the command df -k | awk ' { if (($6 == "/export/temp")... (4 Replies)
Discussion started by: Sheethal
4 Replies

4. Shell Programming and Scripting

Facing problem in checking the directory existence

Hi All, I have a written a scell script which checks the existence of a directory. The dierctory name is read from property file. Though the dierctory exists but it says - it does not exist-- Find my code below -- #! /bin/ksh #Tibco Properties file is inclusion .... (5 Replies)
Discussion started by: supriyabv
5 Replies

5. UNIX for Dummies Questions & Answers

Basic number checking problem

Hello all I am having problems using a bash script to read the input from the user and checking that its a valid number. I only want the user to input a maximum of a 3 number string (321 , 521 , 871 etc.). Anything longer or that includes a chararcter or symbol will display an error message. ... (8 Replies)
Discussion started by: ChrisHoogie
8 Replies

6. Programming

C++ - Problem in asking and checking user's passwd

This is the source code: #include <pwd.h> #include <iostream> #include <string.h> using namespace std; int main() { struct passwd *user; char login="alex", password="qwertyuiop"; if ((user= getpwnam(login)) == NULL) cout << "No such user\n"; else if... (24 Replies)
Discussion started by: hakermania
24 Replies

7. UNIX for Advanced & Expert Users

How to abort file transfer if the file is already existing?

Hi , while doing FTP from mainframe to unix if the file we are sending is already existing in the server ,it is getting replaced.when i used sunique command,its not replacing but stil creates a copy of the file with .1 to .99 extension.is there any way to abort the file transfer if the file is... (3 Replies)
Discussion started by: amodmenon
3 Replies

8. Solaris

I can't copy any file to any machine | abort problem | freezing

I want to copy tar file to another machine. tar size is 4gb. Firstly I tried copy to windows machine with ftp client but copy operation didn't start. Now I have tryied to copy to solaris machine command with scp but copy was freezed. Picture is attached.... (1 Reply)
Discussion started by: getrue
1 Replies

9. Shell Programming and Scripting

Shell Script to Abort if file name has space.

Hi, In my shell script I use the following code to copy files from one directory to other. for file in `ls`; do #----------------- Copy Files From INDIR to OUTDIR -------------# echoen "Copying File ${INDIR}/$file to ${OUTDIR}/${file}" cp ${INDIR}/$file ... (4 Replies)
Discussion started by: pinnacle
4 Replies

10. Shell Programming and Scripting

Problem with ssh and checking if file exists

Hi All, I am facing a problem while checking for existence of file over ssh ! Basically, i want to ssh and check if file exists.. If file exists return 1. If file does not exits return 0 (or any value) I am using the below code file_avail=`ssh username@host "if ]; then exit 1;... (10 Replies)
Discussion started by: galaxy_rocky
10 Replies
abort(3C)																 abort(3C)

NAME
abort() - generate a software abort fault SYNOPSIS
DESCRIPTION
first closes all open files, streams, directory streams, and message catalogue descriptors, if possible, then causes the signal to be sent to the calling process. This may cause a core dump to be generated (see signal(2)). If the signal is caught, the handling function is executed. If the handling function returns, the action for is then reset to and the sig- nal is sent again to the process to ensure that it terminates. RETURN VALUE
does not return. ERRORS
No errors are defined. APPLICATION USAGE
is not intended to be caught. DIAGNOSTICS
If is neither caught nor ignored, and the current directory is writable, a core dump is produced and the message is written by the shell. SEE ALSO
adb(1), exit(2), kill(2), signal(2), signal(5), thread_safety(5). STANDARDS CONFORMANCE
abort(3C)
All times are GMT -4. The time now is 11:22 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy