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!

ความคิดเห็น • 92

  • @sanjaybhatikar
    @sanjaybhatikar 4 ปีที่แล้ว +2

    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.

  • @thelazyboness
    @thelazyboness 5 ปีที่แล้ว +32

    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"

  • @ThePRINCEBARPAGA
    @ThePRINCEBARPAGA 5 ปีที่แล้ว +35

    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.

  • @0493007
    @0493007 7 ปีที่แล้ว +12

    please keep uploading regularly !! thanks for your efforts.

  • @geethapenna4985
    @geethapenna4985 5 ปีที่แล้ว +2

    Clear and excellent tutorials for beginners - thanks.

  • @kmkapil90
    @kmkapil90 5 ปีที่แล้ว

    yes bro u r teaching in a perfect manner. please upload more videos lk this to learn more 😍😍😍😍

  • @sshiv908
    @sshiv908 5 ปีที่แล้ว

    well done.being a beginner,i really liked it.

  • @nileshpatil4683
    @nileshpatil4683 ปีที่แล้ว +1

    Thanks sir. Very easy learning from you.

  • @kesavakumar9768
    @kesavakumar9768 7 ปีที่แล้ว +3

    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

  • @ajayprajapati2453
    @ajayprajapati2453 5 ปีที่แล้ว

    thank you so much!!!Really nice video for learning.

  • @revazzhvania1466
    @revazzhvania1466 4 ปีที่แล้ว +6

    This is fucking perfect. I cant believe this is free. Thank you so much Sir

  • @maihuire11
    @maihuire11 3 ปีที่แล้ว

    Excelente videotutorial de Shell Scripting.

  • @mathooshanthayaparan8169
    @mathooshanthayaparan8169 3 ปีที่แล้ว

    Great tutorials!!!! Hats off

  • @kandpalpreeti1
    @kandpalpreeti1 5 ปีที่แล้ว +1

    Thanks for such good tutorials. show serial interfacing tutorial pls.

  • @sunilkurnella73
    @sunilkurnella73 2 ปีที่แล้ว

    nice video and fully clarity detailed who ever give detailed information so very thanks

  • @PK-wk3on
    @PK-wk3on ปีที่แล้ว

    Loved your content !!!

  • @fads4u123
    @fads4u123 6 ปีที่แล้ว

    nice and simple to understand

  • @dineshn739
    @dineshn739 ปีที่แล้ว

    Ima download it thanks for sharing!!

  • @malwaredev33
    @malwaredev33 ปีที่แล้ว

    Nice video very Informative

  • @mohansai3015
    @mohansai3015 11 หลายเดือนก่อน

    Nice explanation

  • @arrestedmoments667
    @arrestedmoments667 5 ปีที่แล้ว

    So for best tutorial on youtube.

  • @mbv_1
    @mbv_1 4 ปีที่แล้ว +11

    Why did he used quotes for 'echo "Hello World"', and don't use quotes for 'echo The name is $name'?

    • @allancedric9634
      @allancedric9634 4 ปีที่แล้ว +8

      Both ways work: echo $name / echo "$name"
      You have to be careful with it: echo '$name'
      This command will print $name, not the value.

    • @lunaivanov3215
      @lunaivanov3215 3 ปีที่แล้ว +1

      I was wondering the same thing. Thank you, and Allan Cedrid :)

  • @narendranrammudo6726
    @narendranrammudo6726 2 หลายเดือนก่อน +2

    who is watching in 2024 ? shell scripting will not get old

    • @TonyShasta
      @TonyShasta หลายเดือนก่อน

      Thanks for sharing this. I was wondering if this tutorial would be outdated.

  • @josephkamau8643
    @josephkamau8643 4 ปีที่แล้ว

    how do save a shell.....how do i put that multiplication after + because in my keyboard its a star while changing the mode

  • @prabhpreetkaur7758
    @prabhpreetkaur7758 4 ปีที่แล้ว

    Hey, can you mention some of the links of the cheatsheets or tutorials on shell scripting!

  • @technicalresi5451
    @technicalresi5451 6 หลายเดือนก่อน

    Very nice 😊❤

  • @prashantupadhyay6019
    @prashantupadhyay6019 3 ปีที่แล้ว

    Great!! Can you please tell how to pass csv file name as argument and sort

  • @ahmetkarakartal9563
    @ahmetkarakartal9563 ปีที่แล้ว

    thank you so much

  • @tik_tok_comedy8194
    @tik_tok_comedy8194 3 ปีที่แล้ว

    Sir how I create a simple login, logout, register ,hello file and connect to DB using Shell scripting or bash scripting

  • @nimanthipeiris3378
    @nimanthipeiris3378 5 ปีที่แล้ว +2

    This video series is very useful and could I contact you in another social media.

  • @kmSaifullah
    @kmSaifullah 2 ปีที่แล้ว

    Why my user defined variables does not show any result in the terminal?

  • @subbaramaiah59
    @subbaramaiah59 3 ปีที่แล้ว

    Hi I am using macbookpro is it working unix or shall I install ubuntu

  • @Andrzej3935
    @Andrzej3935 5 หลายเดือนก่อน

    Thanks!

  • @omprakashmn
    @omprakashmn 6 ปีที่แล้ว

    Awesome bro

  • @abinayaperumal2571
    @abinayaperumal2571 5 ปีที่แล้ว

    What is the meaning of $1. Why the value change to 0val?

  • @katiescroggins5692
    @katiescroggins5692 ปีที่แล้ว

    thank you!

  • @senisha9976
    @senisha9976 6 ปีที่แล้ว +2

    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.

    • @anirudhc426
      @anirudhc426 5 ปีที่แล้ว +1

      I think the video is just edited, at 9:49 you can see that a command not found error is displayed :)

    • @mandeep259
      @mandeep259 2 ปีที่แล้ว

      You can also use ctrl+l to clear the screen.

  • @arunprasadr7347
    @arunprasadr7347 6 ปีที่แล้ว

    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...

    • @mariamhassan834
      @mariamhassan834 6 ปีที่แล้ว

      Have you tried using speech marks and writing it like name="mark ben"

    • @arunprasadr7347
      @arunprasadr7347 6 ปีที่แล้ว

      Mariam Hassan yes....It works

  • @irwinpalomo7212
    @irwinpalomo7212 7 ปีที่แล้ว

    Gracias!

  • @ziyadkader6767
    @ziyadkader6767 7 ปีที่แล้ว

    great video , whats the name of the font used ?

    • @tarquinthrax7203
      @tarquinthrax7203 6 ปีที่แล้ว

      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.

  • @sushantpatil4193
    @sushantpatil4193 ปีที่แล้ว

    Nice vidio 👍

  • @kaz372
    @kaz372 3 ปีที่แล้ว +1

    $ env
    in terminal to get the full list of environment variables

  • @imtiyaz5775
    @imtiyaz5775 5 ปีที่แล้ว

    Can u tel me like why we r using these commands in our scripts like - $ , ./ , -

  • @mohmmedabd-alrazaq3913
    @mohmmedabd-alrazaq3913 7 ปีที่แล้ว

    can you make more vedios about c++ form application

  • @Conqueroru
    @Conqueroru 5 ปีที่แล้ว

    Subscribed!

  • @signedin0099
    @signedin0099 3 ปีที่แล้ว +1

    Something odd with clear spelling u r typing claer

  • @davelang68
    @davelang68 5 ปีที่แล้ว

    thank you but the spelling errors make it confusing

  • @uptodate8888
    @uptodate8888 5 ปีที่แล้ว

    Sir if we are providing first line like '#! /bin/bash' that means whole line should be commented so why we mentioning this line.

    • @anirudhc426
      @anirudhc426 5 ปีที่แล้ว

      I don't think #! counts as a comment because of the exclamatory mark.

  • @mohamadalasaed
    @mohamadalasaed 3 ปีที่แล้ว

    thank you

  • @prasannakumar4904
    @prasannakumar4904 4 ปีที่แล้ว

    Thanks

  • @prasanthn8999
    @prasanthn8999 6 ปีที่แล้ว

    three types of shell variables are available......not 2

  • @sudhakarmula2356
    @sudhakarmula2356 5 ปีที่แล้ว

    its a unix shell or ubuntu shell

  • @gopikaprabha2602
    @gopikaprabha2602 2 ปีที่แล้ว

    Wat about varnumber like Val10???

  • @jaideepshah7444
    @jaideepshah7444 5 ปีที่แล้ว

    Great !

  • @fit_gaurav009
    @fit_gaurav009 4 ปีที่แล้ว

    can you please tell how to use shell script in windows 10

  • @kaushiknath3957
    @kaushiknath3957 ปีที่แล้ว

    sir, when i am wriitng name = max and then using echo $name, it is showing my command is not found.

    • @chopan6777
      @chopan6777 ปีที่แล้ว +1

      Hello, you must write it without spaces inbetween
      Instead of "name = max", you must write it like this: "name=max"

  • @cherry_36
    @cherry_36 5 ปีที่แล้ว +1

    am i seeing things or the spellings of "clear" just changed? he used claer and it fuckin worked????

  • @FaisalJavid
    @FaisalJavid 4 ปีที่แล้ว

    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.!!!

  • @praveenkumar5261
    @praveenkumar5261 4 ปีที่แล้ว

    it is giving me command not found error when i use name = Mark (on this line)

    • @FaisalJavid
      @FaisalJavid 4 ปีที่แล้ว

      remove the space , write it as
      name=Mark
      it will work

  • @shellgenius
    @shellgenius ปีที่แล้ว

    In depth more

  • @ajinkyagadge5985
    @ajinkyagadge5985 3 ปีที่แล้ว +1

    Good videos but too much Adds.

  • @achin4140
    @achin4140 7 ปีที่แล้ว

    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.

  • @dwiindraprasetia3658
    @dwiindraprasetia3658 3 ปีที่แล้ว

    I like it

  • @saikrishna8513
    @saikrishna8513 2 ปีที่แล้ว

    bro can i get any notes

  • @rahulchowdhury3997
    @rahulchowdhury3997 ปีที่แล้ว

    name=Jeff
    echo My name is $name

  • @LalatenduSwain
    @LalatenduSwain 3 ปีที่แล้ว

    Best

  • @Lita1
    @Lita1 2 ปีที่แล้ว

    yeeeeeeee

  • @Draven1334
    @Draven1334 5 ปีที่แล้ว

    Clean not like other videos is just ummmmm uhhhh or 5 minutes of introductions

  • @KajalJadhav-lj5vs
    @KajalJadhav-lj5vs ปีที่แล้ว

    🧐

  • @GOODBOY-vt1cf
    @GOODBOY-vt1cf 2 ปีที่แล้ว

    8:02

  • @phockuahole
    @phockuahole 7 ปีที่แล้ว +2

    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.

    • @mjjm3111
      @mjjm3111 5 ปีที่แล้ว +1

      Learn to appreciate or buzz off..His explanation is in detail.

  • @54390517
    @54390517 6 ปีที่แล้ว

    i dont know, okay! you tell me if its right or not! stop asking me "right?" !