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.
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 :)
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).
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.
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.
reading advanced bash scripting; and these videos have really helped out a lot thanks.
Thank you man for this simple tutorial, I just made a script to start stop virtual box machine within 5 minutes :)
im a noob, just started learning last week... are these conditionals how things like ping -c10 google.com work? (ping $1 $2)?
I always done int comparisons using -eq, -ne, -gt, -lt etc. I don't know if that makes a difference, does it ?
Awesome. Can you make more intricate videos? Or more of these?
Thanks for fixing the blinking problem and for an amazing video.
It was worth it :)
keep up the epic work
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 :)
Wwwwwwwwwwwww
Very nice, clear tutorials. Thanks.
anyone care to explain to me why he is using two brackets instead of one?
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).
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.
Excellent presentation. Thanks.
I call it that way, but I'm Portuguese witch can influence teh mental process of naming and reading program names :P
Fantastic Thanks..
+kuribohyellowcarrd I'm wondering the same thing
OMG thank you soo mutch (i was a noob with the command line)
No, it doesn't. The if statement will work exactly as it work would with =/==, >=,
nice one .. u got sub from me 👍👌
Floppy
lol this is funny