News for hackers. Stuff that matters.
Re:asdf banned_commands by nequo on Saturday October 29, 2022 @02:53PM (#33386911)
TIL:

  dash$ x="foo\nasd"
  dash$ echo "$x"
  foo
  asd
  dash$ printf "%s\n" "$x"
  foo\nasd
  dash$

  zsh% x="foo\nasd"
  zsh% echo "$x"
  foo
  asd
  zsh% printf "%s\n" "$x"
  foo\nasd
  zsh%

  bash$ x="foo\nasd"
  bash$ echo "$x"
  foo\nasd
  bash$ printf "%s\n" "$x"
  foo\nasd
  bash$
Re:asdf banned_commands by fragmede on Saturday October 29, 2022 @05:11PM (#33387984)

    bash$ echo -e $x
    foo
    asd
    bash$
Re:asdf banned_commands by norvvryo on Saturday October 29, 2022 @05:58PM (#33388350)
Enlightening

From POSIX:

>echo - write arguments to standard output

>If the first operand is -n, or if any of the operands contain a <backslash> character, the results are implementation-defined.

Re:asdf banned_commands by remram on Saturday October 29, 2022 @09:06PM (#33389794)
Wow, TIL indeed. That's conformant to the Single UNIX Specification as well: https://pubs.opengroup.org/onlinepubs/007908799/xcu/echo.htm...