Skip to content

Instantly share code, notes, and snippets.

@rakslice
Created June 12, 2022 23:14
Show Gist options
  • Save rakslice/294512a7449e40b0c79595561968b538 to your computer and use it in GitHub Desktop.
Save rakslice/294512a7449e40b0c79595561968b538 to your computer and use it in GitHub Desktop.
A fragment for AIX PS/2 1.3's /etc/init.dir/B2s.i386 to set the system time from the hardware clock correctly
#This section replaces date `cat /dev/clock`
# Combines the two suggestions from http://ohlandl.ipv7.net/AIX_1-3/AIX_Set_Date.html
TMPDATE=`cat /dev/clock`
date `echo "$TMPDATE"\
| awk '{printf("12312000.00%s",substr($0,0,2));}'`
date `echo "$TMPDATE"\
| awk '{printf("%s",substr($0,3,11));}'`
echo "$TMPDATE" > /dev/clock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment