Sponsored Content
Operating Systems HP-UX awk command in hp UNIX subtract 30 days automatically from current date without date illegal option Post 303027789 by Scrutinizer on Monday 24th of December 2018 11:20:46 AM
Old 12-24-2018
@Bakunin: that looks like a neat trick. It does not seem to work on HP-UX, however (max 24 hours)...
It appears to only work on AIX and IRIX to the full extent.

I found the following maximum time shifts using the date utility with the TZ variable...
Code:
AIX:     Works (No limit)
IRIX:    Works (No Limit)
Tru64:   Max. 7 days
Solaris: Max. 7 days (using /usr/xpg4/bin/date)
MacOS:   Max. 7 days
HP-UX:   Max. 1 day
Linux:   Max. 1 day

Of course on Linux one would not need the trick since it has GNU date...

Last edited by Scrutinizer; 12-24-2018 at 12:29 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to find a date which is 7 days past when given current date

hii all. I have to get the date of the 7th day past from the current date. if i give the current date as sep 3 then i must get the date as 27th of august. can we get the values from the "cal" command. cal | awk '{print $2}' will this type of command work. actually my need is if today is... (17 Replies)
Discussion started by: ladtony
17 Replies

2. Solaris

date -d illegal option in Solaris

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)
Discussion started by: linuxgeek
6 Replies

3. Shell Programming and Scripting

how to get what date was 28 days ago of the current system date IN UNIX

Hi, Anybody knows how to get what date was 28 days ago of the current system date through UNIX script. Ex : - If today is 28th Mar 2010 then I have to delete the files which arrived on 1st Mar 2010, (15 Replies)
Discussion started by: kandi.reddy
15 Replies

4. Shell Programming and Scripting

Date after 5 days from current date in YYYYMMDD format

Hello Experts, How do i get date after 5 days from current date in YYYYMMDD format? How do you compare date in YYYYMMDD format? Thanks (8 Replies)
Discussion started by: needyourhelp10
8 Replies

5. Shell Programming and Scripting

date: illegal option -- d in sun solaris

Hi all, I am trying to execute the following command in a sun solaris machine and getting the error as below. bash-2.03$ date -d "1 day ago" +%Y%m%d date: illegal option -- d bash-2.03$ uname -a SunOS gtrd02 5.8 Generic_117350-55 sun4u sparc SUNW,Sun-Fire-V440 Can anybody help me to... (1 Reply)
Discussion started by: Tuxidow
1 Replies

6. Shell Programming and Scripting

How to Get 60 days Old date from current date in KSH script

Hi i am writing a cron job. so for it i need the 60 days old date form current date in variable. Like today date is 27 jan 2011 then output value will be stote in variable in formet Nov 27. i am using EST date, and tried lot of solution and see lot of post but it did not helpful for me. so... (3 Replies)
Discussion started by: Himanshu_soni
3 Replies

7. Shell Programming and Scripting

Number of days between the current date and user defined date

I am trying to find out the number of days between the current date and user defined date. I took reference from here for the date2jd() function. Modified the function according to my requirement. But its not working properly. Original code from here is working fine. #!/bin/sh... (1 Reply)
Discussion started by: hiten.r.chauhan
1 Replies

8. Shell Programming and Scripting

Seven days past date from current date

hi all.. i want 2 know how 2 find 7days past date from current date.. when i used set datetime = `date '+%m%d%y'` i got 060613.. i just want to know hw to get 053013.. i tried using date functions but couldnt get it :( i use c shell and there is no chance that i can change that ..... (3 Replies)
Discussion started by: Rahul619
3 Replies

9. UNIX for Beginners Questions & Answers

Subscribers with Date 90 days older than current date

I have to display only those subscribers which are in "unconnected state" and the date is 90 days older than today's date. Below command is used for this purpose: cat vfsubscriber_20170817.csv | sed -e 's/^"//' -e '1d' | nawk -F '",' '{if ( (substr($11,2,4) == 2017) && ( substr($11,2,8) -lt... (1 Reply)
Discussion started by: dia
1 Replies

10. Shell Programming and Scripting

Subtract a file's modification date with current date

SunOS -s 5.10 Generic_147440-04 sun4u sparc SUNW,SPARC-Enterprise Hi, In a folder, there are files. I have a script which reads the current date and subtract the modification date of each file. How do I achieve this? Regards, Joe (2 Replies)
Discussion started by: roshanbi
2 Replies
limits(5)							File Formats Manual							 limits(5)

NAME
limits - implementation-specific constants SYNOPSIS
DESCRIPTION
The following symbols are defined in and are used throughout the descriptive text of this manual. The column headed HP-UX Value lists the values that application writers should assume for portability across all HP-UX systems. Symbols after values are interpreted as follows: Actual limit might be greater than specified value on certain HP-UX systems. Actual limit might be greater than value specified in on certain HP-UX systems. Actual limit might be less than the specified value on certain HP-UX systems. Actual limit is always equal to the specified value and does not vary across HP-UX systems. The name of this limit is defined if the preprocessor macro is defined, either by the compilation flag or by a directive in the source before is included in the source. The value defined for this limit might not be a compile-time constant. The value defined always evaluates to an integer expression at run time. Some of these limits vary with system configuration, and can be determined dynamically by using sysconf(2). Others can vary according to file system or device associated with a specific file, and can be determined with pathconf(2). Others are obsolescent because they are redundant with other limits or not useful in portable applications. They are provided only for importability of applications from other systems, to support applications that comply with the and for backward compatibility with earlier versions of HP-UX. The flag should not be defined in new applications. By including the file in the compilation an application can test the appropriate limits to determine whether it can operate on a particular system, or it might even alter its behavior to match the system to increase its portability across a varying range of limit settings and systems. Constant Description HP-UX Value -------------------------------------------------------------------- ARG_MAX Max length of arguments to 5120 +* exec(2) in bytes, including environment data CHAR_BIT Number of bits in a 8 = CHAR_MAX Max integer value of a 127 = CHAR_MIN Min integer value of a -128 = CHILD_MAX Max number of simultaneous 25 +-* processes per user ID CLK_TCK Number of clock ticks per 50 +# second DBL_DIG Digits of precision of a 15 + DBL_MAX Max positive value of a 1.7976931348623157e+308 + DBL_MIN Min positive value of a 4.94065645841246544e-324 - FCHR_MAX Max file offset in bytes INT_MAX +-* FLT_DIG Digits of precision of a 6 + FLT_MAX Max positive value of a 3.40282346638528860e+38 + FLT_MIN Min positive value of a 1.40129846432481707e-45 - INT_MAX Max decimal value of an 2147483647 + INT_MIN Min decimal value of an -2147483648 - LINE_MAX Max number of characters in 2048 = a single line LINK_MAX Max number of links to a 32767 +* single file LOCK_MAX Max number of entries in 32 +-* system lock table LONG_BIT Number of bits in a 32 + LONG_MAX Max decimal value of a 2147483647 + LONG_MIN Min decimal value of a -2147483648 - MAX_CANON Max number of bytes in ter- 512 +* minal canonical input line MAX_CHAR Max number of bytes in ter- MAX_INPUT =* minal input queue MAX_INPUT Max number of bytes in ter- 512 +* minal input queue NAME_MAX Max number of bytes in a 14 +* path name component NL_ARGMAX Max value of "digits" in 9 = calls to the NLS printf(3S) and scanf(3S) functions NL_MSGMAX Max message number in an NLS 32767 + message catalog NL_SETMAX Max set number in an NLS 255 + message catalog NL_TEXTMAX Max number of bytes in an 8192 + NLS message string NGROUPS_MAX Max number of supplementary 20 ++ groups per process OPEN_MAX Max number of files a 60 +* process can have open PASS_MAX Max number of chars in a 8 + password PATH_MAX Max number of characters in 1023 +* a path name excluding the null terminator PID_MAX Max value for a process ID 30000 + PIPE_BUF Max number of bytes atomic 8192 +* in write to a pipe PIPE_MAX Max number of bytes writable INT_MAX + to a pipe in one write PROC_MAX Max number of simultaneous 84 +-* processes on system SCHAR_MAX Max integer value of a 127 = SCHAR_MIN Min integer value of a -128 = SHRT_MAX Max decimal value of a 32767 + SHRT_MIN Min decimal value of a -32768 - STD_BLK Number of bytes in a physi- 512 + cal I/O block SYSPID_MAX Max process ID of system 4 +-* processes SYS_NMLN Length of strings returned 8 +* by uname(2) SYS_OPEN Max number of files open on 120 +-* system TMP_MAX Max number of unique names 17576 + generated by tmpnam(3S) UCHAR_MAX Max integer value of an 255 = UID_MAX Smallest unattainable value 2147483647 + for a user or group ID UINT_MAX Max decimal value of an 4294967295 + ULONG_MAX Max decimal value of an 4294967295 + USHRT_MAX Max decimal value of an 65535 + USI_MAX Max decimal value of an UINT_MAX =* WORD_BIT Number of bits in a "word" 32 + EXAMPLES
has an HP-UX value of which means that on all HP-UX systems the smallest unattainable value for a user or group ID is at least 2147483647. A particular system might be capable of supporting more than 2147483647 user or group IDs, in which case its file sets to a higher value; however, any application assuming such a higher value is not guaranteed to be portable to all HP-UX systems. has an HP-UX value of which means that on all HP-UX systems the smallest maximum number of supplementary groups per process is at least 20. A particular system might be capable of supporting more than 20 supplementary groups per process, in which case will return a larger value than that specified in however, any application assuming such a higher value is not guaranteed to be portable to all HP-UX systems. AUTHOR
limits was developed by HP. SEE ALSO
exec(2), fcntl(2), fork(2), getgroups(2), link(2), lockf(2), open(2), pathconf(2), sysconf(2), uname(2), write(2), printf(3S), scanf(3S), tmpnam(3S), passwd(4), values(5), termio(7). STANDARDS CONFORMANCE
limits(5)
All times are GMT -4. The time now is 06:38 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy