Bash Scripting for Beginners: Complete Guide to Getting Started - While Loops (Part 7)

  Рет қаралды 70,032

Learn Linux TV

Learn Linux TV

Күн бұрын

Пікірлер: 56
@faanross
@faanross 2 жыл бұрын
Can't properly express how grateful I am for this series. Would love if you ever felt inclined to do a more advanced + longer course on networking, server management, and security, would GLADLY pay for that.
@Fallyoou
@Fallyoou 2 жыл бұрын
One of the best channels here on KZbin , i'll give you that.
@LinXnerd
@LinXnerd Жыл бұрын
I thought that Jay was awesome when I started watching this bash series. Now I KNOW that Jay is awesome! I'm thrilled to be learning here and am inspired with many new programming ideas. Thank you Jay!
@wendyudensi2843
@wendyudensi2843 Жыл бұрын
This series is amazing and has helped me understand many concepts easily. He is an awesome teacher. Thanks so much for creating this wonderful content
@whyYUbee
@whyYUbee 9 ай бұрын
I love the fact of the small assignment at the end of this lesson 😊 I just made my small math quiz with while loops and it worked perfectly!
@sippinondroppromotions4276
@sippinondroppromotions4276 Жыл бұрын
Please please do an intermediate/advanced tutorial for instance while loop with arithmetic functions and conditions 😢 you're such a good teacher!
@christopherjohns6155
@christopherjohns6155 Жыл бұрын
This is a great series packed with tons of great examples.
@mago2007
@mago2007 Жыл бұрын
Love the series! Love your channel! Thank you!
@EdwinJimenez-i5n
@EdwinJimenez-i5n Ай бұрын
Very nice of you
@mielushe2lheureux939
@mielushe2lheureux939 Жыл бұрын
Great video! Thank you so much!
@NEXUSSEC
@NEXUSSEC 9 ай бұрын
Tnx captain❤😊
@codermomo1792
@codermomo1792 Жыл бұрын
this is kind of helpful code to let you understand it more counter=0 while [ $counter -le 10 ] do echo "$counter * 7 = $(( $counter * 7 ))" counter=$(( counter+1 )) done
@barkhadibraahim1023
@barkhadibraahim1023 9 ай бұрын
great videos thanks bro
@FHollis-gw4cc
@FHollis-gw4cc 2 жыл бұрын
You might have added that CTRL-C will stop a runaway loop. 🙂
@Abdirahmaann
@Abdirahmaann 2 жыл бұрын
It’s choice
@Abdirahmaann
@Abdirahmaann 2 жыл бұрын
But removing the file is making sense
@user-vt1rb1wy3u
@user-vt1rb1wy3u Жыл бұрын
thank you LOL
@omairtech6711
@omairtech6711 3 ай бұрын
Ain't that obvious? And also that would have defeated the point of the infinite while loops.
@ZaG-yo3fd
@ZaG-yo3fd Жыл бұрын
Hi. Can you explain the subshell a bit in detail? How come you used $(date) What is the main reasoning and is this the only way to get the date command in this particular example? Thanks.
@prasadpatel6508
@prasadpatel6508 Жыл бұрын
Thank you !!
@sreeragsajeev2709
@sreeragsajeev2709 Жыл бұрын
You are the best
@subee128
@subee128 Жыл бұрын
Thanks
@Eilay_Yosfan
@Eilay_Yosfan 7 ай бұрын
thank you
@mihai6564
@mihai6564 Жыл бұрын
good video
@KaskuserKeitt
@KaskuserKeitt Жыл бұрын
cool video)
@Hanesy
@Hanesy 7 ай бұрын
Hello, how do you loop also the echo for The file no longer exists.?
@guilherme5094
@guilherme5094 2 жыл бұрын
👍Thanks!
@stanislasautos3606
@stanislasautos3606 Жыл бұрын
learned while loop
@frankenweeny8785
@frankenweeny8785 Жыл бұрын
The videos are great but can you please to slow down more? Some of us don't understand English fast as others XD
@ps-ri2qk
@ps-ri2qk Жыл бұрын
Under Settings icon, you can reduce the speed of the video playback if that helps
@hussaniislamicchannel
@hussaniislamicchannel 11 ай бұрын
fr? my first language is not English and i can understand it very easily
@peterjansen4826
@peterjansen4826 2 жыл бұрын
myvar=$(($myvar+1)) This part is rather unclear to me. Usually you can set a number to a variable without using a $ before the number but here you have to start with a $-sign. It is not explained why. Clearly the outer () are for the first $-sign (scope) but why do you have to put the $myvar+1 inbetween ()?
@nikhilrbadri5220
@nikhilrbadri5220 2 жыл бұрын
Hey, thanks for asking this, completely overlooked it. But when I went back trying to understand it, I found the reason. The $myvar+1 is an expression and per the syntax described in the manual for expr or in the earlier videos, you'd need to use expr to let bash know that you are attempting to perform an arithmetic operation. Using () around it, negates the use of expr. Check out the manual of expr for more details!
@alissonreinaldosilva1119
@alissonreinaldosilva1119 Жыл бұрын
In other words, both work , the extra parenthesis remove the need for the expr command: myvar=$(expr $myvar + 1) myvar=$(($myvar + 1))
@spasha90
@spasha90 Жыл бұрын
@@alissonreinaldosilva1119 This myvar=$(expr $myvar + 1) does not work, I tried
@DevOps691
@DevOps691 Жыл бұрын
@@spasha90 it works)
@DevOps691
@DevOps691 Жыл бұрын
If I understand right the myvar=$( ) - mean that the "myvar" equal use the value of the result of the variable in the ( ) and additional ( ) to just to replace typing of "expr" command, that is why $(( ))
@Mason-h3w6d
@Mason-h3w6d 11 ай бұрын
Did anyone else have an issue with their results not printing out? The script ran like it was meant to but the numbers didn't appear where they were suppose to, as in there were lines of results with no numbers occupying them.
@neilpatrickhairless
@neilpatrickhairless 9 ай бұрын
For me it just ran 1's without adding, script copied in verbatim
@vinamrajha1571
@vinamrajha1571 11 ай бұрын
in if-else video, you forget to explain about else-if statements.
@Alpha_Sadigh
@Alpha_Sadigh Жыл бұрын
☯🙏
@wheezybackports6444
@wheezybackports6444 2 жыл бұрын
Am I the only one who's never found a real world use for while loops? At least one where it's actually the best way to do something. Most of the time it's better to use a for loop because for loops are easier to control and are more readable.
@faanross
@faanross 2 жыл бұрын
In Python you often use it to purposely induce an infinite loop and assign a break when a certain condition is met - in other words, keep doing this thing forever until x happens. This is often used for example if you prompt the user for input, but only allow them to break from the prompt if the input meets certain conditions, which you can check with for example regex. Unsure how that would work with a for loop.
@faanross
@faanross 2 жыл бұрын
while True: # Code if : break # Code
@wheezybackports6444
@wheezybackports6444 2 жыл бұрын
@@faanross yeah, but that's getting fancy with user input. I really meant while loops in bash. You almost never need them and they're hard to control. When I do user input I just have command line arguments, so the program can be scripted even if it's just something simple.
@GoogleAccount-ki1ww
@GoogleAccount-ki1ww 2 жыл бұрын
@@wheezybackports6444 I’m brand new to bash scripting but I was wondering if a while loop could be useful for waiting for something to finish executing/downloading/loading then once it is finished, to do something else? Or maybe you create a script that flags when a certain user is online and pings you whenever they go offline?
@wheezybackports6444
@wheezybackports6444 2 жыл бұрын
@@GoogleAccount-ki1ww You can use an until loop for that too if you wanted.
@Ca1vema
@Ca1vema Жыл бұрын
You're leaving important concepts unexplained while explaining simple things over and over :( For e.g. Why we have to use subshell and (( to override a variable?
How to treat Acne💉
00:31
ISSEI / いっせい
Рет қаралды 108 МЛН
BAYGUYSTAN | 1 СЕРИЯ | bayGUYS
36:55
bayGUYS
Рет қаралды 1,9 МЛН
Chain Game Strong ⛓️
00:21
Anwar Jibawi
Рет қаралды 41 МЛН
Become a shell wizard in ~12 mins
12:25
CODE IS EVERYTHING
Рет қаралды 271 М.
My 5 Favorite Linux Shell Tricks for SPEEEEEED (and efficiency)
11:06
Starting With Linux: What I Wish I Learned First
23:31
Learn Linux TV
Рет қаралды 512 М.
While loops in Python are easy ♾️
6:58
Bro Code
Рет қаралды 468 М.
Learning Awk Is Essential For Linux Users
20:02
DistroTube
Рет қаралды 315 М.
Learn "fuser", a little-known Linux workhorse command!
7:23
Veronica Explains
Рет қаралды 134 М.
C can do this too and it's faster than Python
2:09:48
Tsoding Daily
Рет қаралды 16 М.
How to treat Acne💉
00:31
ISSEI / いっせい
Рет қаралды 108 МЛН