Hi,
I am facing one problem with date command.Actually I want to use this command to get the last month,not the current month..OK,I can do current month - 1 and give special condition for january,But this time i need last month as strings like January,februaury,march etc...
There is option... (5 Replies)
i need to grep date in the format year-month-day,,,,,,,
actually i need to grep those dates other than current date..........
can anyone help me in this...........i need a format of date which would grep previous date except current date (1 Reply)
How can i assign a variable by the name of CUTDATE= today date - 90 days? i have something like this right now :-
today=`date '+%Y%m%d'`
#cutdate = this is where i am having problem. i need today - 90 days
How can i accomplish this? After that i need to do delete the data which are more... (16 Replies)
Hi Friends,
Need a command/script in unix which calculates previous date from current date.
For ex:
If current date= 01 Jan 2008, then output =31 Dec 2007
If current_date =01 Aug 2008 , then output= 31 July 2008
Please advice
Regards,
Suresh (3 Replies)
Hi all,
I am writing a script which i am executing using nohup command.
while ( true )
do
RequiredTime=06:00:00
SysTime=`echo $(date) | awk '{print $4}'`
if ]; then
body of script
fi
done
this is executing 3 times at 6am. i want it execute the body of script... (3 Replies)
Hi!
Please see our current script:
#!/usr/bin/ksh
if (egrep "This string is found in the log" /a01/bpm.log)
then
mailx -s "Error from log" me@email.com, him@email.com </a01/bpm.log
fi
To the above existing script, we need to add the following change:
1) After finding the string,... (7 Replies)
Hi All,
i get struck in between how to use OR condition in makefile.
Eg:
ifeq ($(PACKAGE),x)
LIBS += $(STRIPPED_LIB-ONLY)
else
ifeq ($(PACKAGE),y)
LIBS += $(STRIPPED_LIB-ONLY)
else
LIBS += $(LIB-ONLY)
endif
endif
so if we look into above... (1 Reply)
Hi All,
I was trying to get the date in format "Feb2" I tried
option "e" giving me a padded space and getting the result as "Feb 2". Though its working fine for dates 10 to 31.
Please suggest me how to get rid of this space before date.
Thanks
Olivia (4 Replies)
I have a file (main.lst) containing a list of dates in DDMMYYYY format. The dates will mostly be the same but it is possible to have multiple dates and these need not be in chronological order. I have another file containing another list of dates (holidays.lst).
The task is to get the latest... (5 Replies)
Hello,
I have this unix script which selects rows from DB where current time is greater than expired time (column). So this will give all the records that are expired 1 day ago, 2 days ago, 3 days ago, etc.. I need help modifying in such that it should give records that are only expired 1 day... (5 Replies)
Discussion started by: jakSun8
5 Replies
LEARN ABOUT OSX
core
CORE(3pm) Perl Programmers Reference Guide CORE(3pm)NAME
CORE - Namespace for Perl's core routines
SYNOPSIS
BEGIN {
*CORE::GLOBAL::hex = sub { 1; };
}
print hex("0x50"),"
"; # prints 1
print CORE::hex("0x50"),"
"; # prints 80
CORE::say "yes"; # prints yes
BEGIN { *shove = &CORE::push; }
shove @array, 1,2,3; # pushes on to @array
DESCRIPTION
The "CORE" namespace gives access to the original built-in functions of Perl. The "CORE" package is built into Perl, and therefore you do
not need to use or require a hypothetical "CORE" module prior to accessing routines in this namespace.
A list of the built-in functions in Perl can be found in perlfunc.
For all Perl keywords, a "CORE::" prefix will force the built-in function to be used, even if it has been overridden or would normally
require the feature pragma. Despite appearances, this has nothing to do with the CORE package, but is part of Perl's syntax.
For many Perl functions, the CORE package contains real subroutines. This feature is new in Perl 5.16. You can take references to these
and make aliases. However, some can only be called as barewords; i.e., you cannot use ampersand syntax (&foo) or call them through
references. See the "shove" example above. These subroutines exist for all overridable keywords, except for "dump" and the infix
operators. Calling with ampersand syntax and through references does not work for the following functions, as they have special syntax
that cannot always be translated into a simple list (e.g., "eof" vs "eof()"):
"chdir", "chomp", "chop", "each", "eof", "exec", "keys", "lstat", "pop", "push", "shift", "splice", "stat", "system", "truncate", "unlink",
"unshift", "values"
OVERRIDING CORE FUNCTIONS
To override a Perl built-in routine with your own version, you need to import it at compile-time. This can be conveniently achieved with
the "subs" pragma. This will affect only the package in which you've imported the said subroutine:
use subs 'chdir';
sub chdir { ... }
chdir $somewhere;
To override a built-in globally (that is, in all namespaces), you need to import your function into the "CORE::GLOBAL" pseudo-namespace at
compile time:
BEGIN {
*CORE::GLOBAL::hex = sub {
# ... your code here
};
}
The new routine will be called whenever a built-in function is called without a qualifying package:
print hex("0x50"),"
"; # prints 1
In both cases, if you want access to the original, unaltered routine, use the "CORE::" prefix:
print CORE::hex("0x50"),"
"; # prints 80
AUTHOR
This documentation provided by Tels <nospam-abuse@bloodgate.com> 2007.
SEE ALSO
perlsub, perlfunc.
perl v5.16.2 2012-10-25 CORE(3pm)