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)
CRM_MON(8) [FIXME: manual] CRM_MON(8)NAME
crm_mon - monitor the cluster's status
SYNOPSIS
crm_mon [-V] -d -pfilename -h filename
crm_mon [-V] [-1|-n|-r] -h filename
crm_mon [-V] [-n|-r] -X filename
crm_mon [-V] [-n|-r] -c|-1
crm_mon [-V] -i interval
crm_mon -?
DESCRIPTION
The crm_mon command allows you to monitor your cluster's status and configuration. Its output includes the number of nodes, uname, uuid,
status, the resources configured in your cluster, and the current status of each. The output of crm_mon can be displayed at the console or
printed into an HTML file. When provided with a cluster configuration file without the status section, crm_mon creates an overview of nodes
and resources as specified in the file.
OPTIONS --help, -?
Provide help.
--verbose, -V
Increase the debug output.
--interval seconds, -i seconds
Determine the update frequency. If -i is not specified, the default of 15 seconds is assumed.
--group-by-node, -n
Group resources by node.
--inactive, -r
Display inactive resources.
--as-console, -c
Display the cluster status on the console.
--one-shot, -1
Display the cluster status once on the console then exit (does not use ncurses).
--as-html filename, -h filename
Write the cluster's status to the specified file.
--daemonize, -d
Run in the background as a daemon.
--pid-file filename, -p filename
Specify the daemon's pid file.
--xml-file filename, -X filename
Specify an XML file containing a cluster configuration and create an overview of the cluster's configuration.
EXAMPLES
Display your cluster's status and get an updated listing every 15 seconds:
crm_mon
Display your cluster's status and get an updated listing after an interval specified by -i. If -i is not given, the default refresh
interval of 15 seconds is assumed:
crm_mon -i interval[s]
Display your cluster's status on the console:
crm_mon -c
Display your cluster's status on the console just once then exit:
crm_mon -1
Display your cluster's status and group resources by node:
crm_mon -n
Display your cluster's status, group resources by node, and include inactive resources in the list:
crm_mon -n -r
Write your cluster's status to an HTML file:
crm_mon -h filename
Run crm_mon as a daemon in the background, specify the daemon's pid file for easier control of the daemon process, and create HTML output.
This option allows you to constantly create HTML output that can be easily processed by other monitoring applications:
crm_mon -d -p filename -h filename
Display the cluster configuration laid out in an existing cluster configuration file (filename), group the resources by node, and include
inactive resources. This command can be used for dry-runs of a cluster configuration before rolling it out to a live cluster.
crm_mon -r -n -X filename
FILES
/var/lib/heartbeat/crm/cib.xml--the CIB (minus status section) on disk. Editing this file directly is strongly discouraged.
AUTHOR
crm_mon was written by Andrew Beekhof.
[FIXME: source] 07/05/2010 CRM_MON(8)