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)
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)
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)
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)
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)
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)
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)
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)
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)
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
LEARN ABOUT DEBIAN
moosex::simpleconfig
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)