mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Created SC2039 (markdown)
6
SC2039.md
Normal file
6
SC2039.md
Normal file
@@ -0,0 +1,6 @@
|
||||
The $'...' construct is widely supported and in the process of being standardized, but it is not yet standard. Many shells do support it, including bash, ksh, zsh, and the busybox "sh" command. Since it is useful, POSIX has recently accepted $'...' (see http://austingroupbugs.net/view.php?id=249 ). However, POSIX-2013 does not include $'...', so a few shells do not yet support it. For now, be more specific about the shell, or use another construct (printf can often do the job).
|
||||
|
||||
The $(...) construct strips trailing newlines. You can retain trailing newlines using this trick:
|
||||
|
||||
newline="$(printf '\nX')"
|
||||
newline="${newline%X}
|
Reference in New Issue
Block a user