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
    Julia Evans (b0rk@social.jvns.ca)'s status on Friday, 22-Nov-2024 05:00:11 JST Julia Evans Julia Evans

    working on this unix redirects diagram today

    In conversation about 6 months ago from social.jvns.ca permalink

    Attachments


    1. https://cdn.masto.host/socialjvnsca/media_attachments/files/113/522/481/960/689/404/original/617d92a7ba6a2096.png
    • Embed this notice
      Peter Krefting (nafmo@social.vivaldi.net)'s status on Friday, 22-Nov-2024 06:25:32 JST Peter Krefting Peter Krefting
      in reply to

      @b0rk If you're covering bash, there are also some other interesting syntax to consider, such as "cat <<<string" and "<(command)", which is not a redirect at all (but incredibly useful, I tend to compare commits using "meld <(git show A) <(git show B)"). There is a corresponding ">(cmd)" syntax that I haven't quite understood myself yet.

      And there is also the confusing case of "sudo ls > foo.txt" which is a bit confusing as to which user it is that writes to foo.txt (use "sudo tee" to write as super-user).

      In conversation about 6 months ago permalink
    • Embed this notice
      Peter Krefting (nafmo@social.vivaldi.net)'s status on Friday, 22-Nov-2024 06:29:06 JST Peter Krefting Peter Krefting
      in reply to
      • Nate Vack 🍴

      @njvack @b0rk There's a minor difference in that in the first case, cmd's file 0 is file.txt, whereas in the second case it is a pipe that will get the contents of file.txt.

      If the file is very large, you might notice a difference in memory usage for the pipe, but for most intents and purposes it shouldn't matter (but the < file.txt form is both less typing and more efficient).

      In conversation about 6 months ago permalink
    • Embed this notice
      Nate Vack 🍴 (njvack@ruby.social)'s status on Friday, 22-Nov-2024 06:29:07 JST Nate Vack 🍴 Nate Vack 🍴
      in reply to

      @b0rk I always forget `cmd < file.txt` and use `cat file.txt | cmd` which I suspect is different in subtle but occasionally important ways

      In conversation about 6 months ago permalink
    • Embed this notice
      Elias (eliasr@social.librem.one)'s status on Friday, 22-Nov-2024 12:29:41 JST Elias Elias
      in reply to

      @b0rk nice! I was confused by the last two parts at first but now I get it: cmd2 is grep 😃

      In conversation about 6 months ago permalink
    • Embed this notice
      Tobias Hellgren (thanius@mastodon.chuggybumba.com)'s status on Friday, 22-Nov-2024 17:06:06 JST Tobias Hellgren Tobias Hellgren
      in reply to

      @b0rk Nice! Have you seen mermaid.live btw?

      In conversation about 6 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.