mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Updated SC2039 (markdown)
@@ -1,4 +1,4 @@
|
|||||||
## In POSIX sh, [\[ ]] is undefined.
|
## In POSIX sh, *something* is undefined.
|
||||||
You have declared that your script works with `/bin/sh`, but you are using features that have undefined behavior according to the POSIX specification.
|
You have declared that your script works with `/bin/sh`, but you are using features that have undefined behavior according to the POSIX specification.
|
||||||
|
|
||||||
It may currently work for you, but it can or will fail on other OS, the same OS with different configurations, from different contexts (like initramfs/chroot), or in different versions of the same OS, including future updates to your current system.
|
It may currently work for you, but it can or will fail on other OS, the same OS with different configurations, from different contexts (like initramfs/chroot), or in different versions of the same OS, including future updates to your current system.
|
||||||
@@ -136,6 +136,7 @@ POSIX:
|
|||||||
|
|
||||||
```sh
|
```sh
|
||||||
# TODO: Interpret it back to printf escapes for hard-to-copy chars like \t?
|
# TODO: Interpret it back to printf escapes for hard-to-copy chars like \t?
|
||||||
|
# See also: http://git.savannah.gnu.org/cgit/libtool.git/tree/gl/build-aux/funclib.sh?id=c60e054c36bb9a937e6d98fd87d6345d20b3f446#n1029
|
||||||
reuse_quote()(
|
reuse_quote()(
|
||||||
for i; do echo -n \'; echo -n "$i" | sed -e "s/'/'\\\\''/g"; echo -n "' "; done
|
for i; do echo -n \'; echo -n "$i" | sed -e "s/'/'\\\\''/g"; echo -n "' "; done
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user