Hi All,
Is it possible to run date -d option in Solaris?
Do we have a work around so that -d option will be recognized
by solaris as it is recognized by linux.
I need this since i am using this in scripting and it works in Linux box. my problem is
it doesn't work in solaris box.
... (6 Replies)
hello. i have a script, but in solaris i get this message sed: illegal option -- i
whats wrong? With Ubuntu there is no problem. Thanks for help.
#!/bin/bash
for file in $(find /directory..../Test/*.txt -type f)
do
head -n 1 $file | egrep '^#!'
if
then
sed -i '2i\Headertext'... (3 Replies)
I'm trying to get the size of each file, but when I try to use
stat -c %s <file>
I get the message
stat: illegal option -- c
Also, the man page for stat shows readlink,stat. It doesn't seem to match the man pages I've seen online.
what is going on here? (6 Replies)
For some reason read -e isn't working in my script. I need a directory as input from a user and I'd like for them to be able to use tab complete which is why I'm using -e. When the script is run, I get:
read: line 6: illegal option -e
In order to just figure out what is going on with the -e... (4 Replies)
current date command runs well
awk -v t="$(date +%Y-%m-%d)" -F "'" '$1 < t' myname.dat
subtract 30 days fails
awk -v t="$(date --date="-30days" +%Y-%m-%d)" -F "'" '$1 < t' myname.dat
awk command in hp unix subtract 30 days automatically from current date without date illegal option error... (20 Replies)
Discussion started by: kmarcus
20 Replies
LEARN ABOUT OSX
apr::date
apache_mod_perl-108~358::mod_perl-2.0.7::docs::api::APR:UsereContributed Perl Docuapache_mod_perl-108~358::mod_perl-2.0.7::docs::api::APR::Date(3)NAME
APR::Date - Perl API for APR date manipulating functions
Synopsis
use APR::Date ();
# parse HTTP-complient date string
$date_string = 'Sun, 06 Nov 1994 08:49:37 GMT';
$date_parsed = APR::Date::parse_http($date_string);
# parse RFC822-complient date string
$date_string = 'Sun, 6 Nov 94 8:49:37 GMT';
$date_parsed = APR::Date::parse_rfc($date_string);
Description
"APR::Socket" provides the Perl interface to APR date manipulating functions.
API
"APR::Date" provides the following functions and/or methods:
"parse_http"
Parse HTTP date strings
$date_parsed = parse_http($date_string);
arg1: $date_string ( string )
The date string can be in one of the following formats:
Sun, 06 Nov 1994 08:49:37 GMT ; RFC 822, updated by RFC 1123
Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036
Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() format
refer to RFC2616 for the details (GMT is assumed, regardless of the used timezone).
ret: $date_parsed ( number )
the number of microseconds since 1 Jan 1970 GMT, or 0 if out of range or if the date is invalid.
since: 2.0.00
Remember to divide the return value by 1_000_000 if you need it in seconds.
"parse_rfc"
Parse a string resembling an RFC 822 date. It's meant to be lenient in its parsing of dates. Hence, this will parse a wider range of
dates than "parse_http()".
$date_parsed = parse_rfc($date_string);
arg1: $date_string ( string )
The date string can be in one of the following formats:
Sun, 06 Nov 1994 08:49:37 GMT ; RFC 822, updated by RFC 1123
Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036
Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() format
Sun, 6 Nov 1994 08:49:37 GMT ; RFC 822, updated by RFC 1123
Sun, 06 Nov 94 08:49:37 GMT ; RFC 822
Sun, 6 Nov 94 08:49:37 GMT ; RFC 822
Sun, 06 Nov 94 08:49 GMT ; Unknown [drtr@ast.cam.ac.uk]
Sun, 6 Nov 94 08:49 GMT ; Unknown [drtr@ast.cam.ac.uk]
Sun, 06 Nov 94 8:49:37 GMT ; Unknown [Elm 70.85]
Sun, 6 Nov 94 8:49:37 GMT ; Unknown [Elm 70.85]
ret: $date_parsed ( number )
the number of microseconds since 1 Jan 1970 GMT, or 0 if out of range or if the date is invalid.
since: 2.0.00
Remember to divide the return value by 1_000_000 if you need it in seconds.
See Also
mod_perl 2.0 documentation.
Copyright
mod_perl 2.0 and its core modules are copyrighted under The Apache Software License, Version 2.0.
Authors
The mod_perl development team and numerous contributors.
perl v5.16.2 2011-02-07 apache_mod_perl-108~358::mod_perl-2.0.7::docs::api::APR::Date(3)