Bash Scripting for Beginners: Complete Guide to Getting Started - Arguments (Part 16)

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

КОМЕНТАРІ •

  • @jondo-vh8tx
    @jondo-vh8tx Рік тому +6

    been looking at video 15 and now time for 16, before that just wanted to say not even my teacher thought me linux that well. you the man when it comes to bash

  • @ShEv441
    @ShEv441 2 роки тому +12

    I watched whole series and I really liked it. You can explain complicated topics. Will you add next episodes to series? I feel like some elements where not discussed in deep like adding flags. I would love to see more episodes for semi advanced users who want to learn more. It's hard to find such content online since most people skip it or only do basicis.

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

    If someone followed all your videos, #! /bin/bash
    lines=$(expr $(ls -lh $1 | wc -l) - 1)
    echo "$lines" would make sense. Kudos!

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

    great course
    thank you very much
    I have another bug for this script
    Give it a directory that does not exist

  • @PyCMD-64
    @PyCMD-64 Рік тому

    great vids. no fluff, all great examples.

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

    Thanks, this will get me into linux commands more.

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

    how to make it so -a or --argument can be parsed?

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

    why no mention of $@

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

      @@jeffreysmith9837 what is that

  • @Leverquin
    @Leverquin 3 місяці тому +1

    why is $((lines-1)) and not $(lines-1)

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

      because $() is a command substitution which will run $(lines-1) in a subshell. (()) denotes mathematical operation. So in other words $((lines-1)) means "do the math and use the result here"

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

      @@stanislavtodorov8705 thank you 💜

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

    Is there a difference between arguments and parameters?

    • @Samuel-pg7tg
      @Samuel-pg7tg Рік тому +4

      Parameters are the names listed in a function definition and arguments are the values passed to a function - if you google arguments vs parameters there's some good info.

  • @MichaelDeBusk
    @MichaelDeBusk 2 роки тому

    I don't understand what makes it a good idea to put the error check after the operation.

    • @ethanrivers4057
      @ethanrivers4057 2 роки тому

      What do you mean by after the operation? The check is performed by the if statement.

    • @MichaelDeBusk
      @MichaelDeBusk 2 роки тому +1

      @@ethanrivers4057 Your script runs the operation on an empty parameter and then decides it shouldn't have done anything. No big deal on the simple thing you're doing in this case, but on a large and elaborate script you'd waste a lot of CPU.
      Make the error check the first thing the script does.

    • @ethanrivers4057
      @ethanrivers4057 2 роки тому

      @@MichaelDeBusk I do understand where you’re coming from, you’re right. I have a script in production that does a back up and before the operation I check that it can be done.

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

      well it does not matter here really it is just a list command and the final output is not printed , but as you say it will be better at the top.

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

    Thank you very much

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

    Tnx superman❤😊

  • @13thravenpurple94
    @13thravenpurple94 Рік тому

    Great video THank you

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

    thanks so much

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

    good video

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

    keep it up i like your content

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

    👍Thanks!

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

    ☯🙏
    Arguments.