Bash Scripting for Beginners: Complete Guide to Getting Started - Data Streams (Part 11)

Поділитися
Вставка
  • Опубліковано 20 вер 2024

КОМЕНТАРІ • 39

  • @jim7smith
    @jim7smith Рік тому +45

    Been using Linux for about 15 years, and this is the best tutorial on scripting I have ever seen. Excellent work, Jay.

  • @whyYUbee
    @whyYUbee 4 місяці тому +2

    The best study for someone with ADHD! I learn so much, so quick, it's crazy! Thank you so much Jay 🙏

  • @jaredlara2850
    @jaredlara2850 Рік тому +3

    I’m a junior in college and have never been taught this. This explains so much. Thanks Jay you dah man🤘🏼🤘🏼

  • @VIXochaP
    @VIXochaP Рік тому +9

    Thanks!

  • @kamaleeswarisrinivasan8273
    @kamaleeswarisrinivasan8273 Місяць тому +1

    Thank you sir keep growing

  • @tengdayz2
    @tengdayz2 4 місяці тому

    I feel like I'm learning Linux the right way from your guide. Thanks for sharing your Linux Expertise.

  • @AlbusRegis
    @AlbusRegis Рік тому +1

    Knowing about data streams is very important because sometimes some programs have very unexpected behavior regarding them. A very good example of this is the tool for creating menus "dialog", which outputs collected data to standard error by default.

  • @user-uk9ze9pe4h
    @user-uk9ze9pe4h 5 місяців тому

    This is by far the best bash scripting tutorial. Thanks a bunch for the free knowledge.

  • @jamesarias2363
    @jamesarias2363 Рік тому +3

    The reason I find this video series so insightful is because it provides real-world examples of how and why you'd use the scripts/commands.
    Most other bash scripting tutorials show you every permutation of commands and parameters without any useful context.

  • @ibukunakinade
    @ibukunakinade Рік тому

    Wow! You made the entire bash scripting look facile. Thank you Jay 🤝

  • @damianpodgorski6977
    @damianpodgorski6977 Рік тому

    I am having so much fun with this series! Thank you Jay

  • @ericablack1847
    @ericablack1847 Рік тому +1

    Excelent work
    You are a very good teacher
    You are a master !

  • @jojobobbubble5688
    @jojobobbubble5688 Рік тому

    I've paid money for longer less helpful programming sessions. Thanks for the information and tutorials!! You're great at this!!!

  • @emoutraspalavras-marloncou4459

    Thank you so much for your time and great tutorial. I have only a question: why is it written in the update script like: "if [ $? -ne 0 ] ...." instead of "if [ $? -eq 2 ] ....."? What would be the difference?

    • @draufunddran
      @draufunddran Рік тому +4

      The difference is that in the first case where the check is for "$? -ne 0" you will get the error message printed on ANY error code other than 0, even 3 and 4 and basically every other exit code that is possible. In the second case with the check for "$? -eq 2" you will only see the error message printed when the actual error code is 2. Most programs have different error codes for different errors. For example there "ls" command returns either 1 or 2 as an error code depending on the error type. I hope this explains it a bit better. To summarize again, you want the message to appear no matter the actual error code is a long as its not the success code which is 0.

  • @fadidib8516
    @fadidib8516 Рік тому

    it s entertaining watching your videos, extremly skilled.

  • @eilayyosfan4417
    @eilayyosfan4417 2 місяці тому

    Thank you

  • @sergiosinanis
    @sergiosinanis 2 місяці тому

    Thanks a lot Jay, just a question, when you re-write the universal update script with the three variables do you actually create two new files (the updater.log and the updater_errors.log) ? Or do they already exist in the system ? Because I thought that in order to create a file you need the touch command 😅 thanks !

  • @mehdi_sf7257
    @mehdi_sf7257 Рік тому

    thank you for teaching us.

  • @JoaoPaulo-ox6pr
    @JoaoPaulo-ox6pr Рік тому +1

    So, now the penny has dropped.
    Those libraries for log management like Winston on JS use data streams to redirect the console output to a file? Why did I take so much time to realize this?
    I knew Data streams, before this bash course, when i was learning coding with python(first language), and thought that was only useful for command line utilities, but now, with a little more knowledge, i can see so many use cases for this.

  • @mihai6564
    @mihai6564 9 місяців тому +1

    good video. I even bought a faster Internet to watch it in better quality.

  • @skmplanet9591
    @skmplanet9591 9 місяців тому

    Very useful tutorial

  • @andrewdatar9880
    @andrewdatar9880 Рік тому

    Great examples to understand stout and stderr, and how to redirect them to file. Unfortunately, this concept cannot be easily used for piping stderr to grep, for example. I find that extremely strange.

  • @Leverquin
    @Leverquin 17 днів тому

    what stands for tail -f? tail is just last rows.. but what is -f

  • @guilherme5094
    @guilherme5094 Рік тому +1

    👍Thanks!

  • @subee128
    @subee128 7 місяців тому

    Thanks

  • @midhunkumara2384
    @midhunkumara2384 10 місяців тому

    can anyone tell what is this "apt does not have a stable CLI interface. Use with caution in scripts" ?

  • @ХайлайтыДлиннойВоли

    You might want to add `--noconfirm` flag for pacman to run silently.

  • @MyAccount-o5c
    @MyAccount-o5c Місяць тому

    Хороший материал

  • @Leverquin
    @Leverquin 17 днів тому

    i thought 0> would show it :c

  • @rohansirohi8335
    @rohansirohi8335 4 місяці тому

    me who already added -y before you said lol 😂

  • @KapilSharma-co8xq
    @KapilSharma-co8xq Рік тому

    If 1 is the exit code for standard output then how come we get exit code 0 after echo.

    • @MrUwU-dj7js
      @MrUwU-dj7js 11 місяців тому

      I think you are confusing things. 0 is exit code for succesful commands, and !=0 is exit code for unsuccesful commands. 1 and 2, on the other hand, is the data stream code used to represent standar output and err, which can be independent to exit codes.
      That is, you can have something with standar errs, but the command can be run succesfully.
      An example would be sudo apt install notexist1 notexists2 notexist3 htop. This will output some standar errs, as there is no package notexists, but apt will still be able to succesfully run this command, as htop can be installed, and this part will be print as standar output. So the command itself is succesfull, despite printing some (not all) standard errs.
      Another example is the one with "find" in the video. The command did not fail, so exit code is 0. But, a bit of the information printed was standar errs. In short, command was succesful (exit code 0), despite there being some standar errs (data stream code 2).
      Note: Take my interpretation with a grain of salt.

    • @KapilSharma-co8xq
      @KapilSharma-co8xq 10 місяців тому

      @@MrUwU-dj7js Thanks for such illustrated explanation.

  • @LearnerHarshalRajeshJain
    @LearnerHarshalRajeshJain Рік тому

    Note :
    Cmd 1 > file1.txt is equivalent to Cmd > file1.txt
    &> means sending both stdin and stderr

  • @RykerFreegeld
    @RykerFreegeld 10 місяців тому

    1000th ✌

  • @AndreyZloy
    @AndreyZloy 8 місяців тому

    Debug script with root permissions... hmm..smart

  • @Vo0idsEmbrace
    @Vo0idsEmbrace 4 місяці тому

    everything in /dev/null is never seen from or heard from again...