Skip to content

Commit c2a9bc1

Browse files
authored
Merge pull request #517 from bjornfor/portable-shebang
Use portable shebang
2 parents 4fc06b9 + 4d0f0b7 commit c2a9bc1

File tree

7 files changed

+17
-17
lines changed

7 files changed

+17
-17
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"

src/timeprivacy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
## Copyright (c) 2013, adrelanos at riseup dot net
44
## All rights reserved.

test/functests/test_exclude_mono.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ get_monotonic_time()
6666
clock_id=$1; shift;
6767
FAKETIME_DONT_FAKE_MONOTONIC=${dont_fake_mono} \
6868
fakecmd "2014-07-21 09:00:00" \
69-
/bin/bash -c "for i in 1 2; do \
69+
bash -c "for i in 1 2; do \
7070
perl -w -MTime::HiRes=clock_gettime,${clock_id} -E \
7171
'say clock_gettime(${clock_id})'; \
7272
sleep 1; \

test/test_variable_data.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
set -e
44

test/testframe.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /bin/bash
1+
#!/usr/bin/env bash
22
# testframe.sh DIR
33
# bare-bones testing framework.
44
# run the test suites in the given DIR;

0 commit comments

Comments
 (0)