Skip to content

Commit

Permalink
rename missed bash something() -> function something
Browse files Browse the repository at this point in the history
In bash, 'function' overrides an existing builtin or even
a command in PATH, unlike the POSIX shell style ().

Signed-off-by: Jiri Jaburek <[email protected]>
  • Loading branch information
comps committed Jun 12, 2022
1 parent 43f8e33 commit 3064801
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/12-interface/cli/run
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# this could be any shell

custom_report() {
function custom_report {
ptef-report \
-c $'PASS \e[1;32mPASS\e[0m ' \
-c $'FAIL \e[1;31mFAIL\e[0m ' \
Expand Down
2 changes: 1 addition & 1 deletion examples/contrib/bash-log-stdout
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# these 3 lines could be in a test library, sourced from here
. /usr/share/ptef/builtins.bash
exec {orig_stdout}>&1 1>&2
ptef_report() { builtin ptef_report "$@" >&"$orig_stdout"; }
function ptef_report { builtin ptef_report "$@" >&"$orig_stdout"; }

# test logic below, any output is logged, even stdout

Expand Down

0 comments on commit 3064801

Please sign in to comment.