soc.octade.net is a Fediverse instance that uses the ActivityPub protocol. In other words, users at this host can communicate with people that use software like Mastodon, Pleroma, Friendica, etc. all around the world.

This server runs the snac software and there is no automatic sign-up process.

Admin email
social@octade.net

Search results for tag #bash

[?]The whale » 🌐
@thewhalecc@framapiaf.org

𝗕𝗮𝘀𝗵 𝗴𝘂𝗶𝗱𝗲:

thewhale.cc/posts/bash-guide

A guide to learn bash: basic operations, basic shell programming, tricks and debugging.

A guide to learn bash: basic operations, basic shell programming, tricks and debugging.

Alt...A guide to learn bash: basic operations, basic shell programming, tricks and debugging.

    [?]🇨🇦Samuel Proulx🇨🇦 » 🌐
    @fastfinge@fed.interfree.ca

    This was invented for . However, I'm finding it really nice for screen readers:
    RTK rewrites output from chatty terminal commands that produce a lot of output, often in complex tables, in order to make the output 80 to 90 percent shorter. Just put rtk in front of the command you want to compress. So "rtk git status" instead of "git status". And you can be sure the compacted output is correct because it's just using regular expressions and deterministic rules under the hood to rewrite output from the tools it knows about. If it doesn't know about a particular command, it just passes the output on unchanged.
    github.com/rtk-ai/rtk
    Now I've got to figure out how to wire this up in
    so it'll just happen without me typing rtk all the time.

      [?]AI6YR Ben » 🌐
      @ai6yr@m.ai6yr.org

      LOL, recursive script and sed = clobbered myself, ha ha. Who needs a malicious AI when you have a defective brain-to-fingers interface? 🤪

        [?]The New Oil » 🤖 🌐
        @thenewoil@mastodon.thenewoil.org

        [?]nickbearded » 🌐
        @nickbearded@mastodon.social

        Thinking of introducing DuckDuckGo AI CLI into my minimalist bashcore CLI distros 🐧

        ​I know, adding cloud AI to a sec-focused distro is controversial. But thanks to DDG's proxy, IP addresses are stripped for maximum privacy.

        ​"That's one small step for a dev, one giant leap for CLI-kind"? 🌕🚀

        ​What do my fellow linux friends think about this big step? Worth it?

          [?]Vassil Nikolov | Васил Николов » 🌐
          @vnikolov@ieji.de

          Here is a "sketch of concept".
          I am not satisfied with it, but it may be better than nothing.
          (Relying on a DEBUG trap isn't really a good thing here, in my view.)

          (1) Example transcript:

          $ echo hello
          hello
          Ready(0); E=0.00 s 10:21:42
          $ sleep 1.5
          Ready(0); E=1.50 s 10:22:06
          $
          Ready(0); E=1.50 s 10:22:07
          $ false | sleep 3.456
          Ready(1 0); E=3.46 s 10:22:47
          $
          Ready(1 0); E=3.46 s 10:22:50
          $ :
          Ready(0); E=0.00 s 10:22:55
          $
          Ready(0); E=0.00 s 10:23:01

          (2) Bash source for the above:

          ### Print the elapsed time for the previous command before each bash prompt.
          ### Uses a DEBUG trap and the PROMPT_COMMAND variable.

          prompt__elapsed_time=""; state.

          function prompt__print_prompt () {
          declare -r s="${PIPESTATUS[*]}";
          if [[ "${prompt__elapsed_time}" == "" ]]; then
          ## The prompt does not change on just pressing Return (no command).
          prompt__elapsed_time="$(printf '%s - %s\n' "${EPOCHREALTIME}" "${prompt__start_time}" | bc)";
          fi;
          ## Imitate IBM z/VM's CMS (partly: the latter prints user time and system time):
          printf 'Ready(%s); E=%.2f s %s\n' "${s}" "${prompt__elapsed_time}" "$(date +%H:%M:%S)";
          }

          function prompt__set_time () {
          if [[ "${BASH_COMMAND}" != "prompt__print_prompt" ]]; then
          prompt__elapsed_time="";
          prompt__start_time=${EPOCHREALTIME};
          fi;
          }

          trap prompt__set_time DEBUG;
          PROMPT_COMMAND=prompt__print_prompt;


          @rl_dane @dougmerritt @AmenZwa @raven667

            [?]R.L. Dane :Debian: :FreeBSD: :OpenBSD: :NetBSD:🍵 :MiraLovesYou: [he/him/my good fellow] » 🌐
            @rl_dane@polymaths.social

            I feel a madness slowly creeping into my mind, and it whispers to me,

            "Write your own version of the #ed editor in #bash, just for giggles."

            NOOOO!! I WILL NOT!!

            THERE ARE FOUR LIGHTS!
            THERE ARE FOUR LIGHTS!
            THERE ARE FOUR LIGHTS!

            :BlobCatBlankieScared:

              [?]R.L. Dane :Debian: :FreeBSD: :OpenBSD: :NetBSD:🍵 :MiraLovesYou: [he/him/my good fellow] » 🌐
              @rl_dane@polymaths.social

              In the #shell #functions I should have written years ago category...

              function fedilinktousername {
                  grep -oE 'https?://[^/]+/@[^/ ]+' |sed -E 's|https?://|@|; s|/@|@|; s/(@[^@]*)(@[^@]*)/\2\1/'
              }
              
              function fediusernametolink {
                  grep -oE '(@[^@ ]+){2}' |sed -E 's|(@[^@ ]+)@([^@ ]+)|https://\2/\1|'
              }
              
              rld@Intrepid:~$ clipo
              https://polymaths.social/@rl_dane/statuses/01KVJCAG6Y4C1KTGBDBECH2778
              rld@Intrepid:~$ clipo |fedilinktousername 
              @rl_dane@polymaths.social
              rld@Intrepid:~$ clipo |fedilinktousername |fediusernametolink 
              https://polymaths.social/@rl_dane
              rld@Intrepid:~$ 
              

              #UnixShell #ShellScripting #Unix #bash #ksh

                [?]Dendrobatus Azureus » 🌐
                @dendrobatus_azureus@polymaths.social

                You and me both my internet friend; I've built quite a few interesting sites using pure HTML which have run for years with very little maintenance, due to their almost static nature

                @rl_dane

                #Firefox #CPU #usage #Dillo #HTML #pure #nostalgia #browser #light #sh #bash

                  [?]Dendrobatus Azureus » 🌐
                  @dendrobatus_azureus@polymaths.social

                  The mistake you maybe making is that you consider Firefox to be a browser.

                  Firefox has stopped being a browser decades ago

                  A browser doesn't need hundreds and hundreds of Engineers to be maintained, a massive project with multiple use angles and cases does

                  Firefox does so many (bad) things you can almost consider it a mini operating system

                  A alpha level Operating System, riddled with security bugs

                  It's always fantastic to be able to go somewhere in dillo and just have fun, amazing yourself with a speed that pages load

                  @rl_dane

                  #Firefox #CPU #usage #Dillo #browser #light #sh #bash

                    [?]R.L. Dane :Debian: :FreeBSD: :OpenBSD: :NetBSD:🍵 :MiraLovesYou: [he/him/my good fellow] » 🌐
                    @rl_dane@polymaths.social

                    Seriously, why didn't I put this in my ~/.bashrc like... YEARS ago? 😆

                    year=$( date +%Y)
                    month=$(date +%m)
                    day=$(  date +%d)
                    

                    #Unix #UnixShell #shell #ShellScripting #bash #bashrc

                      OCTADE boosted

                      [?]Brian Monroe » 🌐
                      @paradoxguitarist@mastodon.online

                      So I DO love me some python, but I just want to say that is awesome.

                      I had no idea this was a thing:

                      echo "${variable/$inTheString/$replacesIt}"