开发者

How to temporary adjust date/time in Linux shell

开发者 https://www.devze.com 2023-04-04 14:13 出处:网络
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 date

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

精彩评论

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