Sponsored Content
Top Forums Shell Programming and Scripting Check the exit status in a pipe call Post 302561972 by Rkolbe on Wednesday 5th of October 2011 03:54:21 PM
Old 10-05-2011
Quote:
Originally Posted by vgersh99
The quoted links should get you started.
It couldn't help me.

As I said my app (an C app) have to be informed if the GZIP got any problem.

Again:
Code:
gzip -dc my_file.gz | my_app

If there is any problem in the gzip uncompression process, my_app must be informed to 'rollback' any previously process.

Thanks

Last edited by Franklin52; 10-06-2011 at 03:19 AM.. Reason: Please use code tags, thank you
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

check the status and send an email with status

Hi, We have a text file which has the following data. ISA~00~ ~00~ ~ZZ~VISTN ~ZZ~U1CAD ~051227~183 7~U~00200~000011258~0~P~< GS~FA~EE05J~U1CAD~051227~1831~000011258~X~002002 ST~997~0001 AK1~SH~247 AK2~856~2470001 AK5~A AK2~856~2470002 AK5~A... (3 Replies)
Discussion started by: isingh786
3 Replies

2. UNIX for Dummies Questions & Answers

how to check exit status in awk script

Hi, I have a main program which have below lines - awk -f test.awk inputFileName - I wonder how to check status return from awk script. content of awk script: test.awk --- if ( pass validation ) { exit 1 } else { (1 Reply)
Discussion started by: epall
1 Replies

3. UNIX for Dummies Questions & Answers

exit status of command in a pipe line

Hi, I am trying to test the exit status of the cleartool lsvtree statement below, but it doesn't seem to be working due to the tail pipe, which it is testing instead. Is there a way around this without adding a tonne of new code? cleartool lsvtree $testlocation/$exe_name | tail -15 ... (10 Replies)
Discussion started by: topcat8
10 Replies

4. Shell Programming and Scripting

check exit status - Expect Script

from my main script, i am calling an expect script. there are a lot of conditions in the Expect script and it can have any exit value based on success or failure of the Expect Script. how can i check the exit status of Expect scritp in the main script. (1 Reply)
Discussion started by: iamcool
1 Replies

5. Shell Programming and Scripting

How to get the exit status

Hi all, I'm running a program which return 1 upon success. But when encounters problem shell return 's '1' . How to differentiate between them the shell return value and script return value. Ex. function fn return '1' if executed successfully and '0' if failed. But when if shell encounters... (1 Reply)
Discussion started by: yhacks
1 Replies

6. Shell Programming and Scripting

check exit status of bg scripts

HI All, I am running one shell script, in that script i am calling 4 scripts in the background. abc.ksh & efg.ksh & xky.ksh & mno.ksh & please let me know, how could i find the success and failure of each script. i Cannot use $?, because i want to run all the scripts in parellel. ... (2 Replies)
Discussion started by: javeed7
2 Replies

7. Shell Programming and Scripting

Check for exit status

Hi I have following code I want If whole code executes successfully then return true If found any error then print the error I tried if ; then But this checks only for the just upper line execution #!/bin/bash PATH1=/var/log/mysql PATH2=/home/ankur/log FILE1=mysql-bin.index... (4 Replies)
Discussion started by: kaushik02018
4 Replies

8. Shell Programming and Scripting

How to check exit status of unset variables

Hi All, Is there any way to check exit status of unset variables? In the following code PathX is not set and the script terminates without checking exit status. #!/bin/bash Path="/tmp/log" cd ${PathX:?} if ;then echo "Exit Status : non zero" else echo "Exit Status :... (2 Replies)
Discussion started by: sussus2326
2 Replies

9. Shell Programming and Scripting

Check/get the exit status of a remote command executed on remote host through script

Geeks, Could you please help me out in my script and identify the missing piece. I need to check/get the exit status of a remote command executed on remote host through script and send out an email when process/processes is/are not running on any/all server(s). Here's the complete... (5 Replies)
Discussion started by: lovesaikrishna
5 Replies

10. Shell Programming and Scripting

Check file if not found send mail if exit call second script

I need to check my script and change to working mode. currently it was not sending the mail and exit without calling the second script. I need to check the file is present ="/home/Rvtools/test.csv" if this file not found after the time retry send mail file not found If the file exit run the... (2 Replies)
Discussion started by: ranjancom2000
2 Replies
MooseX::SimpleConfig(3pm)				User Contributed Perl Documentation				 MooseX::SimpleConfig(3pm)

NAME
MooseX::SimpleConfig - A Moose role for setting attributes from a simple configfile SYNOPSIS
## A YAML configfile named /etc/my_app.yaml: foo: bar baz: 123 ## In your class package My::App; use Moose; with 'MooseX::SimpleConfig'; has 'foo' => (is => 'ro', isa => 'Str', required => 1); has 'baz' => (is => 'rw', isa => 'Int', required => 1); # ... rest of the class here ## in your script #!/usr/bin/perl use My::App; my $app = My::App->new_with_config(configfile => '/etc/my_app.yaml'); # ... rest of the script here #################### ###### combined with MooseX::Getopt: ## In your class package My::App; use Moose; with 'MooseX::SimpleConfig'; with 'MooseX::Getopt'; has 'foo' => (is => 'ro', isa => 'Str', required => 1); has 'baz' => (is => 'rw', isa => 'Int', required => 1); # ... rest of the class here ## in your script #!/usr/bin/perl use My::App; my $app = My::App->new_with_options(); # ... rest of the script here ## on the command line % perl my_app_script.pl -configfile /etc/my_app.yaml -otherthing 123 DESCRIPTION
This role loads simple configfiles to set object attributes. It is based on the abstract role MooseX::ConfigFromFile, and uses Config::Any to load your configfile. Config::Any will in turn support any of a variety of different config formats, detected by the file extension. See Config::Any for more details about supported formats. Like all MooseX::ConfigFromFile -derived configfile loaders, this module is automatically supported by the MooseX::Getopt role as well, which allows specifying "-configfile" on the commandline. ATTRIBUTES
configfile Provided by the base role MooseX::ConfigFromFile. You can provide a default configfile pathname like so: has '+configfile' => ( default => '/etc/myapp.yaml' ); You can pass an array of filenames if you want, but as usual the array has to be wrapped in a sub ref. has '+configfile' => ( default => sub { [ '/etc/myapp.yaml', '/etc/myapp_local.yml' ] } ); Config files are trivially merged at the top level, with the right-hand files taking precedence. CLASS METHODS
new_with_config Provided by the base role MooseX::ConfigFromFile. Acts just like regular "new()", but also accepts an argument "configfile" to specify the configfile from which to load other attributes. Explicit arguments to "new_with_config" will override anything loaded from the configfile. get_config_from_file Called internally by either "new_with_config" or MooseX::Getopt's "new_with_options". Invokes Config::Any to parse "configfile". AUTHOR
Brandon L. Black, <blblack@gmail.com> LICENSE
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-06-19 MooseX::SimpleConfig(3pm)
All times are GMT -4. The time now is 06:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy