Bash Tutorial 3: If Then Else Elif

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

КОМЕНТАРІ • 24

  • @erickalchbrenner553
    @erickalchbrenner553 7 років тому

    Thank you for putting this video up, I've been stuck for a bit trying to make a fairly simple if statement work. Your comment at 0:51 - 1:02 was the part I was missing, spacing around the brackets.

  • @patriciajones5144
    @patriciajones5144 8 років тому

    reading advanced bash scripting; and these videos have really helped out a lot thanks.

  • @kalibatov
    @kalibatov 6 років тому +1

    Thank you man for this simple tutorial, I just made a script to start stop virtual box machine within 5 minutes :)

  • @raintheory3390
    @raintheory3390 8 років тому

    im a noob, just started learning last week... are these conditionals how things like ping -c10 google.com work? (ping $1 $2)?

  • @HerrLlama
    @HerrLlama 11 років тому

    I always done int comparisons using -eq, -ne, -gt, -lt etc. I don't know if that makes a difference, does it ?

  • @RandomDude2008B
    @RandomDude2008B 11 років тому

    Awesome. Can you make more intricate videos? Or more of these?

  • @alymuni
    @alymuni 11 років тому

    Thanks for fixing the blinking problem and for an amazing video.

  • @alymuni
    @alymuni 11 років тому

    It was worth it :)
    keep up the epic work

  • @mdkwlan
    @mdkwlan 11 років тому

    Very well done and very informative. I'll be sharing these series around with some of my programing friends who want get a general idea of bash.
    Thanks :)

  • @robertpendergast2620
    @robertpendergast2620 8 років тому

    Very nice, clear tutorials. Thanks.

  • @kuribohyellowcarrd
    @kuribohyellowcarrd 11 років тому

    anyone care to explain to me why he is using two brackets instead of one?

  • @Markus9705
    @Markus9705 11 років тому

    Does $Num2 really work? I thought it outputted the value of $Num + a "2".
    You can also use [[ ${Var1} == "1" -a ${Var2} == "2" ]] (the -a for "and"). The -o also works for "or".
    The = works as well as ==.
    [[ -n $string ]] checks if a string is non-zero. [[ -z "$string" ]] checks if a string is empty.
    The -r, -w and -x is used for check is file/directory have read, write or execution rights enabled (file permissions).

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

      In doubles square brackets and double parens, you don't need the $ sign at all in front of variables (except in front of the parameters $1 ... $9 for - I hope - obvious reasons).
      Braces would be needed to glue together var names with values: var=1; ${var}2 would be 12.

  • @robertpendergast2620
    @robertpendergast2620 7 років тому

    Excellent presentation. Thanks.

  • @linux5min
    @linux5min 11 років тому

    I call it that way, but I'm Portuguese witch can influence teh mental process of naming and reading program names :P

  • @albu2b1
    @albu2b1 8 років тому +1

    Fantastic Thanks..

  • @md2k6
    @md2k6 8 років тому

    +kuribohyellowcarrd I'm wondering the same thing

  • @Aratar1
    @Aratar1 8 років тому

    OMG thank you soo mutch (i was a noob with the command line)

  • @Markus9705
    @Markus9705 11 років тому

    No, it doesn't. The if statement will work exactly as it work would with =/==, >=,

  • @-__--__aaaa
    @-__--__aaaa 4 роки тому +1

    nice one .. u got sub from me 👍👌

  • @jeanrodrigues6249
    @jeanrodrigues6249 3 роки тому

    Floppy

  • @SignedAdam
    @SignedAdam 11 років тому

    lol this is funny