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
    Haelwenn /элвэн/ :triskell: (lanodan@queer.hacktivis.me)'s status on Friday, 26-Apr-2024 16:55:24 JST Haelwenn /элвэн/ :triskell: Haelwenn /элвэн/ :triskell:
    in reply to
    • Simon Tatham

    @simontatham That's part of POSIX btw.
    And ${parameter:?} allows to also throw an error when it's null rather than only unset, plus ${parameter:?word} would throw word to standard error, which can allow for better errors.

    (posix draft note, in the special case of ${@?} and${*?}` it's undefined behavior)

    In conversation about a year ago from queer.hacktivis.me permalink
    • Embed this notice
      Simon Tatham (simontatham@hachyderm.io)'s status on Friday, 26-Apr-2024 16:55:25 JST Simon Tatham Simon Tatham

      In bash, writing ${var?} instead of just ${var} or $var means if var isn't defined then bash will throw an error and _not_ execute your command, instead of expanding it to "" and carrying on.

      mv file1 file2 $subdir # oops, I overwrote file2
      mv file1 file2 ${subdir?} # error message instead of disaster

      My favourite use of this is for example commands in documentation, with placeholders for the user to fill in. Then it's OK if a user accidentally copy-pastes it _without_ filling them in!

      In conversation about a year ago permalink

      Attachments


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.