My real program is working correctly.
These script are just shown to explain the question.
The code by itself is not important.
My real problem is the coding line
If the last part of a pipe return no error and if a previous part of a pipe return one error (say 123)
1°) What is the value of $RETURN_CODE 0 or 123
2°) Is the return code set to 0 ( if not, I have a problem somewhere in my code)
how to get the error code (123) for the global result which must be considered as failing.
I apologize if I have already posted this query. I scanned back quite a few pages but could not find such a query.
If my perl code contains "exit(33)" how can I get that value in bash for use in a "if" statement.
Thanks,
Siegfried (5 Replies)
I have been given some pSeries AIX servers to maintain. One of the servers wont come up after a shutdown and the following code is showing on the server:
10118401
How do I look up the error code? (2 Replies)
Hello
I have a master startup script (let's call it myScript) that displays a menu from which the user can start/stop several instances of a server. When I issue the start command for one of the servers from the menu and then exit myScript through the provided mechanism (enter "q" in this case),... (2 Replies)
Hi,
I am interesting in writing the following bash codes into perl
My script is simple take field 2 in /etc/passwd and put into an array
#!/bin/bash
PASSWD_FILE=/etc/passwd
A=(`awk -F: ' { print $2 }' $PASSWD_FILE `)
Can someone give me equivalent codes in perl ? (1 Reply)
Good day,
I am trying to add signal handling capabilities to some of my scripts. Unfortunately, I am having some difficulty with the manner in which signals are propagated between parent/child processes. Consider the following example:
I have the following "parent" script:
#!/usr/bin/sh... (5 Replies)
Hi there,
I'm fairly new to bash scripting and already having some troubles. I'm making a script that can print some series of strings in colors based in the information of a file, for simplicity let's say it only does:
#!/bin/bash
printf "\eWhen you execute this in the command line it... (1 Reply)
I want to import the info to shell when the connection to remote host was closed . I have follwed by ssh errors but how to use variables in script.
I am thinking out loud the shell script could look as follow:
svnvaraible=$ERROR_SSH_CONNECTION_LOST
if ; then
break
fi (1 Reply)
Here is my daily stupid question:
How can I tell a script to only execute if the other scripts exits successfully?
So "script A" executes and it executes successfully (0),then "script B" will run
or else
"script A "executes and it exits unsucessfully (1) then "script B" will read return... (6 Replies)
Afternoon ladies and gents,
I am trying to create a simple script to remove a certain file from a user's network profile location. The removal works ok, but in the interest of overkill I would like to add a simple error detection (such as file doesn't exist or permission denied)
Currently, it... (2 Replies)
Do we have common VCS error codes for all platforms.
eg. 10195 Agent(s) for group %s failed on system %s
for all Linux,Solaris and windows ? (1 Reply)
Discussion started by: NIMISH AGARWAL
1 Replies
LEARN ABOUT DEBIAN
net::whois::parser
Net::Whois::Parser(3pm) User Contributed Perl Documentation Net::Whois::Parser(3pm)NAME
Net::Whois::Parser - module for parsing whois information
SYNOPSIS
use Net::Whois::Parser;
my $info = parse_whois( domain => $domain );
my $info = parse_whois( raw => $whois_raw_text, domain => $domain );
my $info = parse_whois( raw => $whois_raw_text, server => $whois_server );
$info = {
nameservers => [
{ domain => 'ns.example.com', ip => '123.123.123.123' },
{ domain => 'ns.example.com' },
],
emails => [ 'admin@example.com' ],
domain => 'example.com',
somefield1 => 'value',
somefield2 => [ 'value', 'value2' ],
...
};
# Your own parsers
sub my_parser {
my ( $text ) = @_;
return {
nameservers => [
{ domain => 'ns.example.com', ip => '123.123.123.123' },
{ domain => 'ns.example.com' },
],
emails => [ 'admin@example.com' ],
somefield => 'value',
somefield2 => [ 'value', 'value2' ],
};
}
$Net::Whois::Parser::PARSERS{'whois.example.com'} = &my_parser;
$Net::Whois::Parser::PARSERS{'DEFAULT'} = &my_default_parser;
# If you want to get all values of fields from all whois answers
$Net::Whois::Parser::GET_ALL_VALUES = 1;
# example
# Net::Whois::Raw returns 2 answers
$raw = [ { text => 'key: value1' }, { text => 'key: value2'}];
$data = parse_whois(raw => $raw);
# If flag is off parser returns
# { key => 'value2' };
# If flag is on parser returns
# { key => [ 'value1', 'value2' ] };
# If you want to convert some field name to another:
$Net::Whois::Parser::FIELD_NAME_CONV{'Domain name'} = 'domain';
# If you want to format some fields.
# I think it is very useful for dates.
$Net::Whois::Parser::HOOKS{'expiration_date'} = [ &format_date ];
DESCRIPTION
Net::Whois::Parser module provides Whois data parsing. You can add your own parsers for any whois server.
FUNCTIONS
parse_whois(%args)
Returns hash of whois data. Arguments:
'domain' -
domain
'raw' -
raw whois text
'server' -
whois server
'which_whois' -
option for Net::Whois::Raw::whois. Default value is QRY_ALL
CHANGES
See file "Changes" in the distribution
AUTHOR
Ivan Sokolov, "<ivsokolov@cpan.org>"
COPYRIGHT & LICENSE
Copyright 2009 Ivan Sokolov
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.14.2 2012-01-20 Net::Whois::Parser(3pm)