Skip to content

Commit 4d0f0b7

Browse files
committed
doc: refer to commands by name, not absolute path
For simplicity and portability. I left some instances in README.OSX as is, because I'm worried about invalidating the docs.
1 parent 9d63a80 commit 4d0f0b7

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

README

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,10 +256,10 @@ the difference:
256256

257257
LD_PRELOAD=src/libfaketime.so.1 FAKETIME="@2000-01-01 11:12:13" \
258258
FAKETIME_DONT_RESET=1 \
259-
/bin/bash -c 'while [ $SECONDS -lt 5 ]; do date; sleep 1; done'
259+
bash -c 'while [ $SECONDS -lt 5 ]; do date; sleep 1; done'
260260

261261
LD_PRELOAD=src/libfaketime.so.1 FAKETIME="@2000-01-01 11:12:13" \
262-
/bin/bash -c 'while [ $SECONDS -lt 5 ]; do date; sleep 1; done'
262+
bash -c 'while [ $SECONDS -lt 5 ]; do date; sleep 1; done'
263263

264264
In the second example, the "date" command will always print the same time,
265265
while in the first example, with FAKETIME_DONT_RESET set, time will increment
@@ -354,7 +354,7 @@ like "+0 x2", i.e., use an explicit zero offset as a prefix in your FAKETIME.
354354
For testing, your should run a command like
355355

356356
LD_PRELOAD=./libfaketime.so.1 FAKETIME="+1,5y x10,0" \
357-
/bin/bash -c 'while true; do echo $SECONDS ; sleep 1 ; done'
357+
bash -c 'while true; do echo $SECONDS ; sleep 1 ; done'
358358

359359
For each second that the endless loop sleeps, the executed bash shell will
360360
think that 10 seconds have passed ($SECONDS is a bash-internal variable

man/faketime.1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ Use a specific GNU-date compatible implementation of the helper used to transfor
4040

4141
.SH EXAMPLES
4242
.nf
43-
faketime 'last Friday 5 pm' /bin/date
44-
faketime '2008-12-24 08:15:42' /bin/date
45-
faketime -f '+2,5y x10,0' /bin/bash -c 'date; while true; do echo $SECONDS ; sleep 1 ; done'
46-
faketime -f '+2,5y x0,50' /bin/bash -c 'date; while true; do echo $SECONDS ; sleep 1 ; done'
47-
faketime -f '+2,5y i2,0' /bin/bash -c 'while true; do date ; sleep 1 ; done'
43+
faketime 'last Friday 5 pm' date
44+
faketime '2008-12-24 08:15:42' date
45+
faketime -f '+2,5y x10,0' bash -c 'date; while true; do echo $SECONDS ; sleep 1 ; done'
46+
faketime -f '+2,5y x0,50' bash -c 'date; while true; do echo $SECONDS ; sleep 1 ; done'
47+
faketime -f '+2,5y i2,0' bash -c 'while true; do date ; sleep 1 ; done'
4848
In this single case all spawned processes will use the same global clock without restarting it at the start of each process.
4949

5050
(Please note that it depends on your locale settings whether . or , has to be used for fractional offsets)

src/faketime.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,11 @@ void usage(const char *name)
8484
" --date-prog PROG : Use specified GNU-compatible implementation of 'date' program\n"
8585
"\n"
8686
"Examples:\n"
87-
"%s 'last friday 5 pm' /bin/date\n"
88-
"%s '2008-12-24 08:15:42' /bin/date\n"
89-
"%s -f '+2,5y x10,0' /bin/bash -c 'date; while true; do echo $SECONDS ; sleep 1 ; done'\n"
90-
"%s -f '+2,5y x0,50' /bin/bash -c 'date; while true; do echo $SECONDS ; sleep 1 ; done'\n"
91-
"%s -f '+2,5y i2,0' /bin/bash -c 'date; while true; do date; sleep 1 ; done'\n"
87+
"%s 'last friday 5 pm' date\n"
88+
"%s '2008-12-24 08:15:42' date\n"
89+
"%s -f '+2,5y x10,0' bash -c 'date; while true; do echo $SECONDS ; sleep 1 ; done'\n"
90+
"%s -f '+2,5y x0,50' bash -c 'date; while true; do echo $SECONDS ; sleep 1 ; done'\n"
91+
"%s -f '+2,5y i2,0' bash -c 'date; while true; do date; sleep 1 ; done'\n"
9292
"In this single case all spawned processes will use the same global clock\n"
9393
"without restarting it at the start of each process.\n\n"
9494
"(Please note that it depends on your locale settings whether . or , has to be used for fractions)\n"

0 commit comments

Comments
 (0)