Subtract Seconds from Date Command

Hi,

Need to subtract 5 seconds after syncing my Linux server from NTP like;

#ntpdate time.myorg.int.

This script will only run once in each morning at 9 AM.

Please help me.

What operating system and shell are you using?

Please explain more clearly what you are trying to do? Are you saying that you want to synchronize the clock on your system to run 5 seconds behind the time used by rest of the world?

My OS is Oracle Linux Enterprise 5.8 and shell is bash

OK. So, you can use date with a -d option.

But, since you didn't answer my second question, I have no idea what other arguments you might want to pass date nor what to do with the results.

With a recent enough bash , try

printf "%s\n" $(($(printf "%(%s)T - 5") ))