The below code is to check if number of lines in file greater than two then status is not ok else status is ok.
I need to optimize it in single line code in awk or sed if possible.
#!/usr/bin/perl
use strict;
use warnings;
use Date::Manip;
my $date_converted = UnixDate(ParseDate("3 days ago"),"%e/%h/%Y");
open FILE,">$ARGV";
while(<DATA>){
my @tab_delimited_array = split(/\t/,$_);
$tab_delimited_array =~ s/^\ =~ s/^\-//;
my $converted_date =... (2 Replies)
Pl help to me to write the below code in a simple way ...
i suupose to use this code 3 to 4 places in my makefile(gnu) ..
****************************************
@for i in $(LIST_A); do \
for j in $(LIST_B); do\
if ;then\
echo "Need to sign"\
echo "List A = $$i , List B =$$j"\
... (2 Replies)
Hi,
I have a requirement with,
No~Dt~Notes
1~2011/08/1~"aaa
bbb
ccc
ddd
eee
fff
ggg
hhh"
Single column alone got splitted into multiple lines.
I require the output as
No~Dt~Notes
1~2011/08/1~"aaa<>bbb<>ccc<>ddd<>eee<>fff<>ggg<>hhh"
mean to say those new lines to be... (1 Reply)
Hi,
My Oracle query is returing below o/p
----------------------------------------------------------
Ins trnas value
a lkp1 x
a lkp1 y
b lkp1 a
b lkp2 x
b lkp2 y ... (7 Replies)
Here is my code. What it does is it reads an input file (input.txt which contains roughly 2,000 search phrases) and searches a directory for files that contains the search phrase. The directory contains roughly 1900 files and 84 subdirectories. The output is a file (output.txt) that shows only the... (23 Replies)
Hi All,
I have 4 big files which contains one big line containing formatted character records, I need to format each file in such way that each File will have 95 Characters per line. Last line of each file will have newline character at end.
Before:-
File Name:- File1.dat
102 121340560... (10 Replies)
here is what i want to achieve.. i have a file with below contents
cat fileName
blah blah blah
.
.DROP this
REJECT that
.
--sport 7800 -j REJECT --reject-with icmp-port-unreachable
--dport 7800 -j REJECT --reject-with icmp-port-unreachable
.
.
.
more blah blah blah
--dport 3306... (14 Replies)
Hi guys,
I feel a bit comfortable now doing bash scripting but I am worried that the way I do it is not optimized and I can do much better as to how I code.
e.g.
I have a whole line in a file from which I want to extract some values.
Right now what I am doing is :
STATE=`cat... (5 Replies)
PACEMAKER(8) System Administration Utilities PACEMAKER(8)NAME
Pacemaker - Part of the Pacemaker cluster resource manager
SYNOPSIS
crm_mon mode [options]
DESCRIPTION
crm_mon - Provides a summary of cluster's current state.
Outputs varying levels of detail in a number of different formats.
OPTIONS
-?, --help
This text
-$, --version
Version information
-V, --verbose
Increase debug output
-Q, --quiet
Display only essential output
Modes:
-h, --as-html=value
Write cluster status to the named html file
-X, --as-xml
Write cluster status as xml to stdout. This will enable one-shot mode.
-w, --web-cgi
Web mode with output suitable for cgi
-s, --simple-status
Display the cluster status once as a simple one line output (suitable for nagios)
Display Options:
-n, --group-by-node
Group resources by node
-r, --inactive
Display inactive resources
-f, --failcounts
Display resource fail counts
-o, --operations
Display resource operation history
-t, --timing-details
Display resource operation history with timing details
-c, --tickets
Display cluster tickets
-W, --watch-fencing
Listen for fencing events. For use with --external-agent, --mail-to and/or --snmp-traps where supported
-L, --neg-locations[=value]
Display negative location constraints [optionally filtered by id prefix]
-A, --show-node-attributes
Display node attributes
Additional Options:
-i, --interval=value
Update frequency in seconds
-1, --one-shot
Display the cluster status once on the console and exit
-N, --disable-ncurses
Disable the use of ncurses
-d, --daemonize
Run in the background as a daemon
-p, --pid-file=value
(Advanced) Daemon pid file location
-E, --external-agent=value
A program to run when resource operations take place.
-e, --external-recipient=value A recipient for your program (assuming you want the program to send something to someone).
EXAMPLES
Display the cluster status on the console with updates as they occur:
# crm_mon
Display the cluster status on the console just once then exit:
# crm_mon -1
Display your cluster status, group resources by node, and include inactive resources in the list:
# crm_mon --group-by-node --inactive
Start crm_mon as a background daemon and have it write the cluster status to an HTML file:
# crm_mon --daemonize --as-html /path/to/docroot/filename.html
Start crm_mon and export the current cluster status as xml to stdout, then exit.:
# crm_mon --as-xml
AUTHOR
Written by Andrew Beekhof
REPORTING BUGS
Report bugs to pacemaker@oss.clusterlabs.org
Pacemaker 1.1.10-29.el7 June 2014 PACEMAKER(8)