- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- scripting in unix
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-30-2006 03:15 AM
тАО11-30-2006 03:15 AM
scripting in unix
u_pw_expire_warning#1728000
When multiplying 60 seconds x 60 minutes x 24 you get 86400 x the number of days prior to expiration in this case 20 would = 1728000.
I hope there is an answer out there somewhere. I hope that this can be done in shell scripting.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-30-2006 03:21 AM
тАО11-30-2006 03:21 AM
Re: scripting in unix
# perl -le 'print scalar localtime((time+1728000))'
Wed Dec 20 11:21:06 2006
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-30-2006 03:23 AM
тАО11-30-2006 03:23 AM
Re: scripting in unix
NUM=1728000
DAY=86400
PWEXPWARNDAYS=$(echo ${NUM}/${DAY} | bc)
echo "You will be warned the password will expire ${PWEXPWARNDAYS} days before expiration"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-30-2006 03:23 AM
тАО11-30-2006 03:23 AM
Re: scripting in unix
Sorry, I should generalize this to be more useful to you:
# perl -le 'print scalar localtime((time+$ARGV[0]))' 1728000
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-30-2006 03:24 AM
тАО11-30-2006 03:24 AM
Re: scripting in unix
There is a good script by our point leader A. Clay Stephenson that I use on Unix and ported to Linux.
The Date Hammer
http://hpux.ws/merijn/caljd-2.25.sh
http://hpux.ws/merijn/caljd-2.2.pl
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-30-2006 03:24 AM
тАО11-30-2006 03:24 AM
Re: scripting in unix
typeset -i SECONDS=1728000
typeset -i DAYS=0
DAYS=$(( ${DAYS} / 86400 ))
echo "${SECONDS} seconds equals ${DAYS} days."
Note: The shell can only do signed 32-bit integer math so that for example 5/2 does not equal 2.5 but rather 2.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-30-2006 03:26 AM
тАО11-30-2006 03:26 AM
Re: scripting in unix
please read
http://forums1.itrc.hp.com/service/forums/helptips.do?#33
then review your previous threads.
A shell solution:
#!/usr/bin/sh
number=$1
days=`expr $number / 86400`
echo $days
$ ./b.sh 1728000
20
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-30-2006 03:26 AM
тАО11-30-2006 03:26 AM
Re: scripting in unix
If you can forgo the decimal:
$ echo $(( 1728000 / 86400 ))
If not:
$ echo "scale=2; 1728000 / 86400" | bc
PCS