Is there a way to increment the time for n seconds? I am thinking something
# touch -F n foo
which will increment the time by n seconds and
# touch -B n foo
which will decrement the time by n seconds.
Use touch -t or touch --time=foo for now.
Adding -F and -B wouldn't be much of a problem, but it would be nonstandard
extensions (or are they supported anywhere else?)
What I want is to make a file, bar, a few seconds newer than
foo. It is used for make. I'd like to do
# touch -t foo bar
# touch -F 1 bar
so that bar is 1 second newer than foo. I don't want to bar to
to have the current time since foo might have been updated
between it was checked out and bar was generated.
Created attachment 32718 [details]
Patch adding -F and -B
Works slightly different though:
To achieve your example, simply
touch -r foo -F 1 bar
I've added this patch in 4.1-6
this is a nifty feature. Is there any particular reason for
dropping it in recent fileutils packages, or was it just by
accident when branching back to older releases?
(I think I have an updated patch available.)
Gru_ an bero,