user3121138
user3121138

Reputation: 49

How to increase one hours current date in DEC UNIX 4.0?

I need to add one hours to current date in DEC UNIX V4.0?

I tried "date" command but in this version of that command "-v" or "-s" and etc switch doesn't work.

for example:

date -s "5 seconds"

doesn't work.

Upvotes: 0

Views: 52

Answers (1)

Jonathan Leffler
Jonathan Leffler

Reputation: 753655

I assume you have already read the DEC manual page and observed that there is no option that matches the -v or -s options in GNU date. From that, you will conclude that you'll have to write your own code or get someone else's already written code to do the job — and you'll conclude that installing someone else's working code is easier than writing your own code.

The simplest fix, therefore, is to install GNU coreutils and use the date command from that. Of course, there are some tricky bits to deal with. You'll probably not want to install the GNU date command in /bin or /usr/bin because that might break other scripts that expect the DEC version of the date command (it probably won't, but it might, and you're likely to be cautious — if you weren't cautious, you wouldn't still be using DEC UNIX). So, you probably need to add it to /usr/local/bin, or maybe you create a new directory such as /usr/gnu/bin (add --prefix=/usr/gnu to the ./configure command when you build the core utilities). And then you ensure that the commands that need to use GNU date reference it explicitly. (Commands that don't insist on using GNU date should continue to use DEC date.)

Upvotes: 1

Related Questions