开发者

How to temporary adjust date/time in Linux shell

I want to write some testscripts that create some files and execute commands that change behaviour depending on the current date. For testing purposes I would like to change the time to different dates (in the past and future) and check the behaviour.

Is it possible to change the date exclusively just for a singe shell-session, or fool a single application about the current dat开发者_如何转开发e? - how could this be done?


this can be done to a program with libfaketime which is preload library i.e. LD_PRELOAD.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜