Sponsored Content
Top Forums Shell Programming and Scripting Need help fix my script to get alerts when the command produce n expected output Post 302946728 by RudiC on Thursday 11th of June 2015 04:45:44 PM
Old 06-11-2015
Do you want to distinguish between individual "other than successful" cases or would just "failure" suffice? Do single keywords in a line (or other features) identify a success or a failure?
This might point you in a direction:
Code:
RESARRAY=(SUCCESS FAILURE)
curl -k -s -S --header 'Content-Type: text/xml;charset=UTF-8' --data @"${SOAPFILE}" "${URL}" | awk '/success/ {XCOD=0} /[Ff]ault/ {XCOD=1} 1; END {exit XCOD}'
mailx -s ${RESARRAY[$?]} $MAILTO

This User Gave Thanks to RudiC For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl Script to produce a file

hi i got a file called essay which contain few pages with many paragraphs. now i wanna with PERL to produce another file which called Essaylist that contain a sorted list of words that appear in the file essay. the format for Essaylist: $word found $times times on page a b c.... where $word... (3 Replies)
Discussion started by: mingming88
3 Replies

2. Shell Programming and Scripting

Caller Script should produce and email from 4 different script within it

Hi I wrote a shell script , which includes one output file which is emailed back to me , when the script runs . Now i want to slip the script into 4 different shell scripts each of which taking the parameter PROD or DEV, and include all the 4 different shell scripts in a caller script. ... (3 Replies)
Discussion started by: rxg
3 Replies

3. Shell Programming and Scripting

get file content and produce command

hi buddies; ip.txt: 192.168.1.1 192.168.1.2 192.168.1.3 192.168.1.4 192.168.1.5 ... parameters.txt: portvalue username password session ... (2 Replies)
Discussion started by: gc_sw
2 Replies

4. Red Hat

how to produce date command o/p

Hello I am trying of a solution to produce date cmnd o/p as: Feb 18 is the 049 day of the year. Any ideas how to produce this? (2 Replies)
Discussion started by: ranumala
2 Replies

5. Shell Programming and Scripting

Not getting expected output

Hi I have written below script to get the data in table form. #!/bin/sh echo "File Name\tType" for i in *; do echo "$i\t\c" if ; then echo "directory" elif ; then echo "symbolic link" elif ; then echo "file" else echo "unknown" fi donehowever i am getting output in different way... (3 Replies)
Discussion started by: scriptor
3 Replies

6. Shell Programming and Scripting

How to produce a executable Oracle script from bash script?

Hi here's my code ${ORACLE_HOME}/bin/sqlplus /nolog <<!EOF --step 5 create db script start set feedback off set heading off set echo off conn / as sysdba spool ${ORACLE_SID}_db_link.sql SELECT 'CREATE '||DECODE(U.NAME,'PUBLIC','public ')||'DATABASE LINK '||CHR(10)... (2 Replies)
Discussion started by: jediwannabe
2 Replies

7. Shell Programming and Scripting

Join two files combining multiple columns and produce mix and match output

I would like to join two files when two columns in each file matches with each other and then produce an output when taking multiple columns. Like I have file A 1234,ABCD,23,JOHN,NJ,USA 2345,ABCD,24,SAM,NY,USA 5678,GHIJ,24,TOM,NY,USA 5678,WXYZ,27,MAT,NJ,USA and file B ... (2 Replies)
Discussion started by: mady135
2 Replies

8. Infrastructure Monitoring

Autosys - cleaning alerts thru command line

Hello- I am currently researching on an autosys command that can be invoked via command line that can clean-up alerts. The reason I ask is because we have jobs that activate on a daily basis. The job polls whether it needs to run or not (via filewatcher or some database check). If the job isn't... (0 Replies)
Discussion started by: cec_can
0 Replies

9. Shell Programming and Scripting

Bash script unable to disable expected output

I'm trying to understand why a script behaves different when run through a pipe. My OS: Linux myip 3.13.0-92-generic #139-Ubuntu SMP Tue Jun 28 20:42:26 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux This script (myscript.sh): #!/bin/bash echo whoami: whoami echo who: who echo who... (2 Replies)
Discussion started by: SkySmart
2 Replies

10. Shell Programming and Scripting

Gawk --- produce the output in pattern space instead of END space

hi, I'm trying to calculate IP addresses and their respective calls to our apache Server. The standard format of the input is HOST IP DATE/TIME - - "GET/POST reuest" "User Agent" HOST IP DATE/TIME - - "GET/POST reuest" "User Agent" HOST IP DATE/TIME - - "GET/POST reuest" "User Agent" HOST... (2 Replies)
Discussion started by: busyboy
2 Replies
Courriel::HeaderAttribute(3pm)				User Contributed Perl Documentation			    Courriel::HeaderAttribute(3pm)

NAME
Courriel::HeaderAttribute - A single attribute belonging to a header VERSION
version 0.29 SYNOPSIS
my $ct = $headers->get('Content-Type'); print $ct->get_attribute('charset')->value(); DESCRIPTION
This class represents a single attribute belonging to a header. An attribute consists of a name and value, with optional charset and language information. API
This class supports the following methods: Courriel::HeaderAttribute->new( ... ) This method creates a new object. It accepts the following parameters: o name The name of the attribute. This should be a non-empty string. o value The value of the attribute. This can be empty. o charset The charset for the value. If the value contains any non-ASCII data, this will always be "UTF-8", otherwise the default is "us-ascii". o language The language for the attribute's value. It should be a valid ISO language code like "en-us" or "zh". This is optional. $attribute->name() The attribute name as passed to the constructor. $attribute->value() The attribute value as passed to the constructor. $attribute->charset() The attribute's charset. $attribute->language() The attribute's language. $attribute->as_string() This returns the attribute in a form suitable for putting in an email. This may involve escaping, quoting, splitting up, and otherwise messing with the value. If the value needs to be split across continuations, each name/value pair is returned separate by a space, but not folded across multiple lines. $attribute->stream_to( output => $output ) This method will send the stringified attribute to the specified output. The output can be a subroutine reference, a filehandle, or an object with a "print()" method. The output may be sent as a single string, as a list of strings, or via multiple calls to the output. ROLES
This class does the "Courriel::Role::Streams" role. AUTHOR
Dave Rolsky <autarch@urth.org> COPYRIGHT AND LICENSE
This software is Copyright (c) 2012 by Dave Rolsky. This is free software, licensed under: The Artistic License 2.0 (GPL Compatible) perl v5.14.2 2012-03-07 Courriel::HeaderAttribute(3pm)
All times are GMT -4. The time now is 09:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy