Shell Scripting Tutorial for Beginners 2 - using Variables and Comments
ฝัง
- เผยแพร่เมื่อ 1 มิ.ย. 2024
- In Linux (Shell), there are two types of variable:
(1) System variables - Created and maintained by Linux itself. This type of variable defined in CAPITAL LETTERS.
(2) User defined variables (UDV) - Created and maintained by user. This type of variable defined in lower letters.
Shell variables
- var refers to the name, $var to the value
- t = 100 #Sets var t to value 100
- echo ”\$t = $t” #will print: $t = 100
- Remove a variable with unset var
- Names begin with alpha characters and include alpha, numeric, or underscore
★★★Top Online Courses From ProgrammingKnowledge ★★★
Python Programming Course ➡️ bit.ly/2vsuMaS ⚫️ bit.ly/2GOaeQB
Java Programming Course ➡️ bit.ly/2GEfQMf ⚫️ bit.ly/2Vvjy4a
Bash Shell Scripting Course ➡️ bit.ly/2DBVF0C ⚫️ bit.ly/2UM06vF
Linux Command Line Tutorials ➡️ bit.ly/2IXuil0 ⚫️ bit.ly/2IXukt8
C Programming Course ➡️ bit.ly/2GQCiD1 ⚫️ bit.ly/2ZGN6ej
C++ Programming Course ➡️ bit.ly/2V4oEVJ ⚫️ bit.ly/2XMvqMs
PHP Programming Course ➡️ bit.ly/2XP71WH ⚫️ bit.ly/2vs3od6
Android Development Course ➡️ bit.ly/2UHih5H ⚫️ bit.ly/2IMhVci
C# Programming Course ➡️ bit.ly/2Vr7HEl ⚫️ bit.ly/2W6RXTU
JavaFx Programming Course ➡️ bit.ly/2XMvZWA ⚫️ bit.ly/2V2CoAi
NodeJs Programming Course ➡️ bit.ly/2GPg7gA ⚫️ bit.ly/2GQYTQ2
Jenkins Course For Developers and DevOps ➡️ bit.ly/2Wd4l4W ⚫️ bit.ly/2J1B1ug
Scala Programming Tutorial Course ➡️ bit.ly/2PysyA4 ⚫️ bit.ly/2PCaVj2
Bootstrap Responsive Web Design Tutorial ➡️ bit.ly/2DFQ2yC ⚫️ bit.ly/2VoJWwH
MongoDB Tutorial Course ➡️ bit.ly/2LaCJfP ⚫️ bit.ly/2WaI7Ap
QT C++ GUI Tutorial For Beginners ➡️ bit.ly/2vwqHSZ
★★★ Online Courses to learn ★★★
Get 2 FREE Months of Unlimited Classes from skillshare - skillshare.eqcm.net/r1KEj
Data Science - bit.ly/2lD9h5L | bit.ly/2lI8wIl
Machine Learning - bit.ly/2WGGQpb | bit.ly/2GghLXX
Artificial Intelligence - bit.ly/2lYqaYx | bit.ly/2NmaPya
MERN Stack E-Degree Program - bit.ly/2kx2NFe | bit.ly/2lWj4no
DevOps E-degree - bit.ly/2k1PwUQ | bit.ly/2k8Ypfy
Data Analytics with R - bit.ly/2lBKqz8 | bit.ly/2lAjos3
AWS Certification Training - bit.ly/2kmLtTu | bit.ly/2lAkQL1
Projects in Java - bit.ly/2kzn25d | bit.ly/2lBMffs
Machine Learning With TensorFlow - bit.ly/2m1z3AF | bit.ly/2lBMhnA
Angular 8 - Complete Essential Guide - bit.ly/2lYvYRP
Kotlin Android Development Masterclass - bit.ly/2GcblsI
Learn iOS Programming Building Advance Projects - bit.ly/2kyX7ue
★★★ Follow ★★★
My Website - www.codebind.com
DISCLAIMER: This video and description contains affiliate links, which means that if you click on one of the product links, I’ll receive a small commission. This help support the channel and allows us to continue to make videos like this. Thank you for the support!
Nice video! I searched high and low for good shell scripting tutorials to automate jobs on my Raspberry Pi. Some tutorials were too fragmented and others dragged in too much extraneous stuff. Your series is a godsend. Thank you and keep up the good work.
First of all thanks for such neat and clean explanation !!! Your videos are really helpful for beginners .....I must say - Good Job !! You can add one more point in this video about types of comment because we have two types of comment - single line and multi line . Single line you taught but you forgot to talk about the multi line comment I guess .
Well I will add here no problem -------
Multi line comment is noting but you can skip few lines to execute or you can write multi line notes to explain program like below
--------------------------------------
#! /bin/bash
echo "This is first line"
Thanks
Thanks!
Nice video, I think you should gone in depth. For example illustrating and example how to store multiple values. For anyone reading this, if you want to store mutliple values in a variable like then you need to use " " to store, like (myvar="Hello Wolrd"). If you just declare it as (myvar= Hello World) then it will only print (Hello). I hope this helps.
exactly more details are needed on this topic
Hello
😅😅popp❤ my om bbbbkbffffesuss
please keep uploading regularly !! thanks for your efforts.
Clear and excellent tutorials for beginners - thanks.
yes bro u r teaching in a perfect manner. please upload more videos lk this to learn more 😍😍😍😍
well done.being a beginner,i really liked it.
Thanks sir. Very easy learning from you.
sir your tutorials helped me a lot ,,, im learning php,,,, why dont you make tutorials on OOPs and MVC concept in PHP,, consider its a request
thank you so much!!!Really nice video for learning.
This is fucking perfect. I cant believe this is free. Thank you so much Sir
Excelente videotutorial de Shell Scripting.
Great tutorials!!!! Hats off
Thanks for such good tutorials. show serial interfacing tutorial pls.
nice video and fully clarity detailed who ever give detailed information so very thanks
Loved your content !!!
nice and simple to understand
Ima download it thanks for sharing!!
Nice video very Informative
Nice explanation
So for best tutorial on youtube.
Why did he used quotes for 'echo "Hello World"', and don't use quotes for 'echo The name is $name'?
Both ways work: echo $name / echo "$name"
You have to be careful with it: echo '$name'
This command will print $name, not the value.
I was wondering the same thing. Thank you, and Allan Cedrid :)
who is watching in 2024 ? shell scripting will not get old
Thanks for sharing this. I was wondering if this tutorial would be outdated.
how do save a shell.....how do i put that multiplication after + because in my keyboard its a star while changing the mode
Hey, can you mention some of the links of the cheatsheets or tutorials on shell scripting!
Very nice 😊❤
Great!! Can you please tell how to pass csv file name as argument and sort
thank you so much
Sir how I create a simple login, logout, register ,hello file and connect to DB using Shell scripting or bash scripting
This video series is very useful and could I contact you in another social media.
Why my user defined variables does not show any result in the terminal?
Hi I am using macbookpro is it working unix or shall I install ubuntu
Thanks!
Awesome bro
What is the meaning of $1. Why the value change to 0val?
thank you!
just wondering, how you are executing 'clear' command with a wrong spelling 'claer'? please share this, I also want to change the spellings of system commands.
regards,
Nisha Verma.
I think the video is just edited, at 9:49 you can see that a command not found error is displayed :)
You can also use ctrl+l to clear the screen.
hi nice tutorial thanks for ur awesome efforts, i have a small query. In the user-defined variable, if i assign name=Mark Ben it throwing an error "Ben command not found", please help me out from this... thanks in Adv...
Have you tried using speech marks and writing it like name="mark ben"
Mariam Hassan yes....It works
Gracias!
great video , whats the name of the font used ?
I believe the font is called Menlo. That's what my terminal is using, and my font looks exactly like his. Mine is Menlo regular 13 pt.
Nice vidio 👍
$ env
in terminal to get the full list of environment variables
Can u tel me like why we r using these commands in our scripts like - $ , ./ , -
can you make more vedios about c++ form application
Subscribed!
Something odd with clear spelling u r typing claer
thank you but the spelling errors make it confusing
Sir if we are providing first line like '#! /bin/bash' that means whole line should be commented so why we mentioning this line.
I don't think #! counts as a comment because of the exclamatory mark.
thank you
Thanks
three types of shell variables are available......not 2
its a unix shell or ubuntu shell
Wat about varnumber like Val10???
Great !
can you please tell how to use shell script in windows 10
sir, when i am wriitng name = max and then using echo $name, it is showing my command is not found.
Hello, you must write it without spaces inbetween
Instead of "name = max", you must write it like this: "name=max"
am i seeing things or the spellings of "clear" just changed? he used claer and it fuckin worked????
Help: Subscribers/Users.!!!
After learning this series where can/will i use this.
And for what purpose i can use scripting?
it seem like a programming language to me.!!!
you can use it for Splunk
you can use it for big data purpose
it is giving me command not found error when i use name = Mark (on this line)
remove the space , write it as
name=Mark
it will work
In depth more
Good videos but too much Adds.
i beg you sir please i am crying please tell
• Enterprise Java Beans Architecture.
• EJB roles, Types of EJB’s
• Stateless and State full Session Beans
• Entity Beans
• Container Managed Persistence and Bean Managed Persistence
• Deploying an Enterprise Java Beans Object.
Add a public reply.
I like it
bro can i get any notes
name=Jeff
echo My name is $name
Best
yeeeeeeee
Clean not like other videos is just ummmmm uhhhh or 5 minutes of introductions
🧐
8:02
8:35 why take the time to show an error scenario few if any will make, just to prove it won't work? if u even have to mention such a scenario, just say it won't work u don't have to prove it.
Learn to appreciate or buzz off..His explanation is in detail.
i dont know, okay! you tell me if its right or not! stop asking me "right?" !