-
-
Notifications
You must be signed in to change notification settings - Fork 371
Open
Description
$ mkdir -p /tmp/test && cd "$_"
$ printf '#!/usr/bin/env sh\necho one\n' >one.sh
$ printf '#!/usr/bin/env bash\necho two\n' >two
$ shfmt -f .
one.sh
two
$ shfmt -f -ln=bash .
one.sh
two
$ shfmt -f -ln=posix .
one.sh
two
$ shfmt -f -p .
one.sh
two
One could argue that -f
in combination with -ln
/-p
should filter and only show the matching scripts:
$ shfmt -f -ln=bash .
two
$ shfmt -f -ln=posix .
one.sh
$ shfmt -f -p .
one.sh
This would be useful if one wants to copy only scripts of a specific dialect.
Let's say one has a host/docker image without bash
and one just wants to copy the POSIX-conformant scripts.
Metadata
Metadata
Assignees
Labels
No labels