GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Conversation

Notices

  1. Embed this notice
    Will T (wjt@mastodon.me.uk)'s status on Tuesday, 07-Nov-2023 07:48:27 JST Will T Will T

    In the last year or so I read an article thoroughly investigating whether the idiom

    [ x$foo = x ]

    is still needed in modern-day /bin/sh, concluding that it is not if you quote the variable. But it's surprisingly hard to search for. Does anyone happen to have a link lying around?

    Edit: found it! https://www.vidarholen.net/contents/blog/?p=1035

    In conversation Tuesday, 07-Nov-2023 07:48:27 JST from mastodon.me.uk permalink

    Attachments

    1. No result found on File_thumbnail lookup.
      What exactly was the point of [ “x$var” = “xval” ]?
      from Vidar
    • Embed this notice
      Haelwenn /элвэн/ :triskell: (lanodan@queer.hacktivis.me)'s status on Tuesday, 07-Nov-2023 08:09:46 JST Haelwenn /элвэн/ :triskell: Haelwenn /элвэн/ :triskell:
      in reply to
      • eukara :steampowered:

      @eukara @wjt I've seen it many times, specially in ./configure scripts (auto*hell or not), in fact I wouldn't be surprised to have written similar ones myself either due to:
      - Cargo-cult / keeping things consistent with the rest of the code;
      - Rules around shell quoting being a PITA;
      - Not wanting pure-whitespace/empty-string to be truthful. Like ${foo:-yes} and ${foo:=yes} only acts if it's actually undefined. And how test -n $foo is for empty string;
      - Outside of nicely defined commands like test: GNU and it's annoying implementation of getopt.

      In conversation Tuesday, 07-Nov-2023 08:09:46 JST permalink
    • Embed this notice
      eukara :steampowered: (eukara@idtech.space)'s status on Tuesday, 07-Nov-2023 08:09:47 JST eukara :steampowered: eukara :steampowered:
      in reply to
      @wjt That was a fun read, love me some UNIX history. Don't think I've come across this hack myself before
      In conversation Tuesday, 07-Nov-2023 08:09:47 JST permalink

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.