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

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

КОМЕНТАРІ • 43

  • @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 5 місяців тому +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🤘🏼🤘🏼

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

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

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

    Thanks!

  • @tengdayz2
    @tengdayz2 6 місяців тому

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

  • @EdnovStormbrewer
    @EdnovStormbrewer 27 днів тому

    Thank you for the video. Probably one of the best ones I've seen so far.
    However, it's not a good idea executing the script while logged in as root for /var/log. There is a much safer alternative which is logging files right where the universal updater script is as user. Other than that, keep up the great work.

  • @ChimiChuri-k2o
    @ChimiChuri-k2o Місяць тому

    23:00 that is soo cool :D

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

    Thank you sir keep growing

  • @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.

  • @NorwegiansCantCook
    @NorwegiansCantCook Місяць тому

    Thanks

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

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

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

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

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

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

  • @future-jim
    @future-jim Рік тому +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.

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

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

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

    it s entertaining watching your videos, extremly skilled.

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

    Thank you

  • @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 Рік тому +5

      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.

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

    Very useful tutorial

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

    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 !

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

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

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

    thank you for teaching us.

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

    Thanks

  • @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.

  • @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.

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

    👍Thanks!

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

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

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

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

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

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

  • @rohansirohi8335
    @rohansirohi8335 6 місяців тому

    me who already added -y before you said lol 😂

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

    i thought 0> would show it :c

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

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

  • @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 Рік тому

      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 Рік тому

      @@MrUwU-dj7js Thanks for such illustrated explanation.

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

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

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

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

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

    1000th ✌

  • @Vo0idsEmbrace
    @Vo0idsEmbrace 5 місяців тому

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