Log in Sign up
2 Matching Annotations
  1. Sep 2023
  2. stackoverflow.com stackoverflow.com
    Why does bash ignore newlines when doing for loop over the contents of a C-style string?
    1
    1. TylerRick 22 Sep 2023
      in Public
      Bash doesn't do word expansion on quoted strings in this context. For example: $ for i in "a b c d"; do echo $i; done a b c d $ for i in a b c d; do echo $i; done a b c d
      confusing for newcomers shell scripting: handling spaces in input shell: argument expansion/quoting shell caveat key point
    Visit annotations in context

    Tags

    • key point
    • shell: argument expansion/quoting
    • confusing for newcomers
    • shell scripting: handling spaces in input
    • caveat
    • shell

    Annotators

    • TylerRick

    URL

    stackoverflow.com/questions/1650573/why-does-bash-ignore-newlines-when-doing-for-loop-over-the-contents-of-a-c-style
  3. Apr 2021
  4. stackoverflow.com stackoverflow.com
    How to trick an application into thinking its stdout is a terminal, not a pipe
    1
    1. TylerRick 14 Apr 2021
      in Public
      The quirky looking printf is necessary to correctly expand the script's arguments in $@ while protecting possibly quoted parts of the command (see example below).
      shell: argument expansion/quoting best practices escaping (encoding)
    Visit annotations in context

    Tags

    • shell: argument expansion/quoting
    • best practices
    • escaping (encoding)

    Annotators

    • TylerRick

    URL

    stackoverflow.com/questions/1401002/how-to-trick-an-application-into-thinking-its-stdout-is-a-terminal-not-a-pipe
Share:
Group. Only group members will be able to view this annotation.
Only me. No one else will be able to view this annotation.
Hypothes.is
  • About
  • Blog
  • Bioscience
  • Education
  • Jobs
  • Help
  • Contact
  • Terms of Service
  • Privacy Policy