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)
clusvcadm(8) Red Hat Cluster Suite clusvcadm(8)NAME
clusvcadm - Cluster User Service Administration Utility
SYNOPSIS
clusvcadm [-d <service> ] [-e <service> ] [-l] [-u] [-S] [-m <member> ] [-r <service> ] [-R <service> ] [-M <service> ] [-Z <service> ] [-U
<service> ] [-s <service> ] [-v]
DESCRIPTION
The clusvcadm command allows an administrator to enable, disable, relocate, and restart user services in a cluster. In order to perform
cluster service operations, the cluster daemons must be running (and have quorum) on the member system on which the command is invoked.
OPTIONS -d <service>
Stops and disables the user service named service
-e <service>
Enables and starts the user service named service
-l Lock services in preparation for cluster shutdown. This should only be used if the administrator intends to perform a global, clus-
ter wide shutdown. This prevents services from starting (but not stopping, like -Z does). Once the cluster quorum is dissolved,
this state is reset. If a new instance of rgmanager boots while others are locked, the behavior is undefined.
-u Unlock resource group managers. This allows services to start again.
-S Display whether the resource group managers are locked or not. This can be used to verify the correct operation of the -l and -u
options, but is only useful for debugging.
-m <member>
When used in conjunction with either the -e or -r options, this specifies the preferred target member on which to start the service.
-r <service>
Relocates the user service named service to another cluster member.
-R <service>
Restarts the user service named service on the cluster member on which it is currently running.
-M <service>
Use a special "migration" operation to move the user service named service to another cluster member. Currently, this is only use-
ful for virtual machines. Use of migration usually requires special configuration of the local virtual machine manager in order to
work correctly.
-Z <service>
Freezes the service named service on the cluster member on which it is currently running. This will prevent status checks of the
service as well as failover in the event the node fails or rgmanager is stopped.
-U <service>
Unfreezes the user service named service on the cluster member on which it is currently running. This will re-enable status checks.
-s <service>
Stops the service named service until a member transition or until it is enabled again.
-v Display version information and exit.
NOTES
Executing -U (unfreeze) on a service which was frozen in the started state while the service owner is offline results in an undefined (and
possibly dangerous) condition. Manually ensure all resources are clear before doing this.
SEE ALSO clustat(8)
Jan 2005 clusvcadm(8)