Here's a slightly more elaborate awk script which works on the same principle as the sed I posted previously, but includes the zero counts and avoids the need to sort the output. It also somewhat separates the data from the logic. Still missing is a facility to make some of the matching case-insensitive.
Hi,
I am new script programming, I have written a script shown velow to read username and passwd from /etc/security/passwd, i am able to read username, but unable to grep lastupdate. please look into the code and suggest if any changes need.
#!/bin/ksh
USERNAME=""
fname=/usr/bin/lastupdate... (1 Reply)
Hi,
I want to check whether a file of the format myfile_YYYYMMDD_HHMMSS.txt exists in a particular directory. Here YYYYMMDD_HHMMSS is the time stamp, so it will be numbers always .
What is the best method to do this
I did it like this :
ls myfile_*_*.txt
but it will list files... (1 Reply)
Hi
I have the following at the end of a service shutdown script used in part of an active-passive failover setup:
###
# Shutdown all primary Network Interfaces
# associated with failover
###
# get interface names based on IP's
# and shut them down to simulate loss of
# heartbeatd
... (1 Reply)
Hi
I am new to Unix/Linux
I know commands and shell scripts which are useful for my project.
But i need to know the basics and commands and shell scripts in detail and easy guide.
Please refer a book.
Thanks
Haripatn (6 Replies)
Hi!
I need to install a application from one server to several other servers. My script would copy the install-script to other machines and run it.Since it has to be non-interactive , just wondering if yum can be used for the same.
Please let me know , if you guys are aware of other... (1 Reply)
hi i need to get the values from an xml file like the <TAG> values and write to a file please suggest me the commands and some good reading material sites so that i can implement (1 Reply)
Pls review this code and provide your feedbacks to make it more efficient.I have tried to add to each section.
Code
###############################################################
#!/bin/ksh
RRSRC=/test
RREP=/test
#Directories
test_dir=/test
#Imp Files
FILENAME=/test/files.txt
#... (5 Replies)
i am jaswanth,
i am very new to unix/linux, upto now i worked in windows only., but i took coatching for unix.., and my sir teached all my classes in red hat linux and told me that all are same...!!!
I know shall programming in red hat linux..,
but now i installed opensloaris but the... (5 Replies)
Hi,
I'm a beginner and am learning c programming. I want to learn UNIX/LINUX in parallel. But I don't know difference between UNIX and LINUX and where they are applied in real life. As a beginner, some people asked me to start with UNIX. Please let me know some very good books for UNIX. Also a... (6 Replies)
Discussion started by: nerdbee
6 Replies
LEARN ABOUT DEBIAN
universal::isa
UNIVERSAL::isa(3pm) User Contributed Perl Documentation UNIVERSAL::isa(3pm)NAME
UNIVERSAL::isa - recover from people calling UNIVERSAL::isa as a function
SYNOPSIS
# from the shell
echo 'export PERL5OPT=-MUNIVERSAL::isa' >> /etc/profile
# within your program
use UNIVERSAL::isa;
# enable warnings for all dodgy uses of UNIVERSAL::isa
use UNIVERSAL::isa 'verbose';
DESCRIPTION
Whenever you use "isa" in UNIVERSAL as a function, a kitten using Test::MockObject dies. Normally, the kittens would be helpless, but if
they use UNIVERSAL::isa (the module whose docs you are reading), the kittens can live long and prosper.
This module replaces "UNIVERSAL::isa" with a version that makes sure that, when called as a function on objects which override "isa", "isa"
will call the appropriate method on those objects
In all other cases, the real "UNIVERSAL::isa" gets called directly.
NOTE: You should use this module only for debugging purposes. It does not belong as a dependency in running code.
WARNINGS
If the lexical warnings pragma is available, this module will emit a warning for each naughty invocation of "UNIVERSAL::isa". Silence these
warnings by saying:
no warnings 'UNIVERSAL::isa';
in the lexical scope of the naughty code.
After version 1.00, warnings only appear when naughty code calls UNIVERSAL::isa() as a function on an invocant for which there is an
overridden isa(). These are really truly active bugs, and you should fix them rather than relying on this module to find them.
To get warnings for all potentially dangerous uses of UNIVERSAL::isa() as a function, not a method (that is, for all uses of the method as
a function, which are latent bugs, if not bugs that will break your code as it exists now), pass the "verbose" flag when using the module.
This can generate many extra warnings, but they're more specific as to the actual wrong practice and they usually suggest proper fixes.
SEE ALSO
Perl::Critic::Policy::BuiltinFunctions::ProhibitUniversalIsa
UNIVERSAL::can for another discussion of the problem at hand.
Test::MockObject for one example of a module that really needs to override "isa()".
Any decent explanation of OO to understand why calling methods as functions is a staggeringly bad idea.
AUTHORS
Audrey Tang <cpan@audreyt.org>
chromatic <chromatic@wgz.org>
Yuval Kogman <nothingmuch@woobling.org>
COPYRIGHT & LICENSE
Copyright (c) 2005 - 2011, chromatic. This module is made available under the same terms as Perl 5.12.
perl v5.14.2 2012-04-18 UNIVERSAL::isa(3pm)