I am using Solaris O/S. Here are the basic stats for UNIX O/S I am using:
$ oslevel
7.1.0.0
$ ps
PID TTY TIME CMD
10944546 pts/1 0:00 -ksh
17563840 pts/1 0:00 ps
$
I am need to write a text on the first line of a text file
test.txt
Text I need to add to the first line on test.txt
is
MHHHRGFILE (sysdate - First day of 9 months) 99991231
For middle part (sysdate - First day of 9 months), for eg. Today's date is 07/26/2017, I will need to minus 9 months and then first day of that month. Meaning, I will need to print 20161001
Basically I will end up writing:
MHHHRGFILE 20161001 99991231
to the first line of the file test.txt
where MHHHRGFILE and 99991231 are staying constant all the time.
oslevel
and its output of 7.1.0.0 make that look a lot like an AIX system, not a Solaris one.