Get the Content of a File without CAT in BASH

Поделиться
HTML-код
  • Опубликовано: 28 янв 2025

Комментарии • 28

  • @SNSISNSJISEJSJS
    @SNSISNSJISEJSJS 11 дней назад +1

    I love pure bash work or projects 👾

    • @DigitalMetal
      @DigitalMetal  11 дней назад

      I always find them interesting myself.

  • @octopusonfire100
    @octopusonfire100 11 дней назад

    I love this kind of videos. ❤

  • @smilingcatonlinux5998
    @smilingcatonlinux5998 11 дней назад +1

    Thanks Kris, Love CAT too :°) - have a smile -

  • @cyberoptic5757
    @cyberoptic5757 11 дней назад +1

    Thank you. That's helpful. In what environment would I lack tools such as cat? Or is portability an element to consider?

    • @kaslmineer7999
      @kaslmineer7999 11 дней назад

      no environment has no cat, unless you manually remove both /bin/ and /usr/bin/

    • @DigitalMetal
      @DigitalMetal  11 дней назад

      I don't think you will ever really see a system without cat. But, some people try to be extra efficient with their code and cat would be an extra process you don't need. Even if you always plan on using cat, it's good to know about this, in case you are looking at someone else's code.

    • @skilletpan5674
      @skilletpan5674 10 дней назад

      Only embedded systems that don't need it like a router linux os (mind you most allow you to run a basic shell and having cat is handy).

  • @Linux.Learner
    @Linux.Learner 11 дней назад

    awesome, SIRE!!!🤔

  • @kaslmineer7999
    @kaslmineer7999 11 дней назад +2

    echo and printf were initally external commands in /usr/bin/echo and /usr/bin/printf
    however people were using loops and complicated stuff that need to outout really quickly so each time printf or echo is invoked the hardddrive (or even with a modern ssd) needs to read which's inpractical for such basic task
    so they intregrated it to the shell, however /bin/echo is vastly diffrent than echo shell builtin in some shells and /usr/bin/printf is vastly diffrent than the bash printf builtin
    /bin/echo and /usr/bin/printf are still in modern systems for backwards compatablity as showen in the following output:
    ```
    $ type -a echo
    echo is a shell builtin
    echo is /usr/bin/echo
    echo is /bin/echo
    $ type -a printf
    printf is a shell builtin
    printf is /usr/bin/printf
    printf is /bin/printf
    $
    ```

  • @luispakvard5681
    @luispakvard5681 2 дня назад

    Could you write a script which change grub2 background image on the random image ? Very interesting

  • @bhaveshverma8629
    @bhaveshverma8629 11 дней назад

    Lovely

  • @SlideRSB
    @SlideRSB 10 дней назад

    But, why??

    • @Chaos666Theory
      @Chaos666Theory 10 дней назад +1

      My initial thought too. I mean, it's cool. That's enough for me.

    • @DigitalMetal
      @DigitalMetal  9 дней назад +1

      Why Not? That's my question.
      But one reason is, less processes. Cat is external and every time you call it, you are starting a new process. 99% of the time that doesn't matter, but on a big project with a lots of loops, it could effect speed.
      Beyond that, it's not uncommon for people to do this. So, even if you never do it, know that you can will help you read other people's code.

    • @assakurayoh
      @assakurayoh 8 дней назад

      So many times you don't have cat in a docker container because people thought it should not exist in a container...
      It's actually very very very usefuul

  • @kaslmineer7999
    @kaslmineer7999 11 дней назад

    why does this video make me feel like those linux users who say "/usr/bin/cat shall not exist in linux and its impure!"

    • @DigitalMetal
      @DigitalMetal  11 дней назад

      I never heard anyone say that. But I can also see people saying that.

    • @kaslmineer7999
      @kaslmineer7999 10 дней назад

      ​@@DigitalMetal the type of people i usually see saying this do:
      - using arch linux and brag about it
      - being chronically and using the computer for 36 hours each day for no reason
      - being a reddit user

    • @skilletpan5674
      @skilletpan5674 10 дней назад

      ​@@kaslmineer7999brain damage? Cat has been in unix/linux for decades.

    • @kaslmineer7999
      @kaslmineer7999 9 дней назад

      ​@@skilletpan5674those people who say cat shall not exist probably have braindamage or something in their brain

  • @weedeater64
    @weedeater64 3 дня назад

    Cat is soydev bloatware!!
    TIL.