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
    Jan Wildeboer 😷:krulorange: (jwildeboer@social.wildeboer.net)'s status on Sunday, 19-Jan-2025 21:38:31 JST Jan Wildeboer 😷:krulorange: Jan Wildeboer 😷:krulorange:

    #lazyweb Weird thing. When using `sed` in a makefile context, its seems to behave slightly different than expected, as explained in [1]. More precise: To capture the end of a line, you normally use $ as the last character in the search expression, but in a makefile context it somehow needs $$. The linked post explains *THAT* it works this way but not *WHY*. This upsets me ;) Can anyone explain what is going on here?

    [1] https://stackoverflow.com/questions/57301214/why-using-two-dollar-sign-instead-of-just-single-dollar-sign-for-bl

    In conversation about 4 months ago from social.wildeboer.net permalink

    Attachments

    1. Domain not in remote thumbnail source whitelist: cdn.sstatic.net
      why using "$$" (two dollar sign) instead of just "$" (single dollar sign) for blank line removal in Makefile?
      I met some old Makefile script which was designed to delete blank lines using the sed command. The code itself is pretty easy and straightforward. sed -i -e '/^[ \t]*$$/ d' I know the ^[ \t]*$ p...
    • Embed this notice
      Jan Wildeboer 😷:krulorange: (jwildeboer@social.wildeboer.net)'s status on Sunday, 19-Jan-2025 21:48:18 JST Jan Wildeboer 😷:krulorange: Jan Wildeboer 😷:krulorange:
      in reply to
      • thp

      @thp Hrmbl. I'll try to add that weirdness to my brain in the hope it can recall it when needed.Thank you for the through explanation!

      In conversation about 4 months ago permalink
    • Embed this notice
      thp (thp@dosgame.club)'s status on Sunday, 19-Jan-2025 21:48:20 JST thp thp
      in reply to

      @jwildeboer The backslash is interpreted by the shell, the single "$" is interpreted (consumed) by make, as it tries to access a variable $" (dollar-sign, followed by double-quote). To echo a "$", you need to:

      1. Escape using "\" for the shell
      2. Escape using "$$" for make

      Note how the make output of the first file is just the line:

      echo "\

      And the second invocation gets it as:

      echo "\$"

      In conversation about 4 months ago permalink

      Attachments


      1. https://dosgame.club/system/media_attachments/files/113/855/076/240/114/246/original/d56fa9ac60d0ca15.png
    • Embed this notice
      thp (thp@dosgame.club)'s status on Sunday, 19-Jan-2025 21:48:21 JST thp thp
      in reply to

      @jwildeboer Make treats "$" as special character. $$ escapes it, so that the shell sees just a "$".

      In conversation about 4 months ago permalink
    • Embed this notice
      Jan Wildeboer 😷:krulorange: (jwildeboer@social.wildeboer.net)'s status on Sunday, 19-Jan-2025 21:56:11 JST Jan Wildeboer 😷:krulorange: Jan Wildeboer 😷:krulorange:
      in reply to
      • thp

      @thp (also, #mastodon, markdown for code blocks in toots, when? ;)

      In conversation about 4 months ago permalink
    • Embed this notice
      Jan Wildeboer 😷:krulorange: (jwildeboer@social.wildeboer.net)'s status on Sunday, 19-Jan-2025 22:07:50 JST Jan Wildeboer 😷:krulorange: Jan Wildeboer 😷:krulorange:
      in reply to
      • Joost van Baal-Ilić

      @joostvb Got that (and actually knew that, but is was deeply buried in my brain) I just missed the mental connection as I saw this syntax in a docker compose file :)

      In conversation about 4 months ago permalink
    • Embed this notice
      Joost van Baal-Ilić (joostvb@mastodon.green)'s status on Sunday, 19-Jan-2025 22:07:52 JST Joost van Baal-Ilić Joost van Baal-Ilić
      in reply to

      @jwildeboer you have to escape a $ in make since it's a special character to make.

      In conversation about 4 months ago permalink
    • Embed this notice
      Jan Wildeboer 😷:krulorange: (jwildeboer@social.wildeboer.net)'s status on Sunday, 19-Jan-2025 22:10:18 JST Jan Wildeboer 😷:krulorange: Jan Wildeboer 😷:krulorange:
      in reply to

      Thank you for the replies and explanations! Variable expansion in makefiles is the answer. Why I saw that syntax in a docker compose file is now the next question. I *guess* because it does a similar thing wrt variable expansion before handing the sed command to be executed, but I am not that much of a docker expert.

      In conversation about 4 months ago permalink
    • Embed this notice
      Jan Wildeboer 😷:krulorange: (jwildeboer@social.wildeboer.net)'s status on Sunday, 19-Jan-2025 22:42:47 JST Jan Wildeboer 😷:krulorange: Jan Wildeboer 😷:krulorange:
      in reply to
      • Wusel

      @mrwslpro Yep. That thread occupied my brain and disturbed my sleep, so I needed to dive deeper :)

      In conversation about 4 months ago permalink
    • Embed this notice
      Wusel (mrwslpro@procial.tchncs.de)'s status on Sunday, 19-Jan-2025 22:42:49 JST Wusel Wusel
      in reply to

      @jwildeboer@social.wildeboer.net this question felt like a deja vu. And it kind of was: reading the question in forgejo's chat ha

      In conversation about 4 months ago 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.