Skip to content

Commit bff0359

Browse files
committed
code cleanup: use &&/|| instead of if/else
1 parent 1358723 commit bff0359

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,5 @@ teeAndCopy() {
2424
tee >(content="$(cat)"; echo -n "$content" | copy)
2525
}
2626

27-
if [ $# -eq 0 ]; then
28-
teeAndCopy
29-
else
30-
"$@" | teeAndCopy
31-
fi
27+
[ $# -eq 0 ] && teeAndCopy ||
28+
"$@" | teeAndCopy

0 commit comments

Comments
 (0)