Bash Scripting on Linux (The Complete Guide) Class 03 - Variables

  Рет қаралды 111,629

Learn Linux TV

Learn Linux TV

Күн бұрын

Welcome to LearnLinuxTV's brand new complete course on Bash Scripting! In this 18 episode series, you'll learn everything you need to know in order to start writing Bash scripts. Each video builds on the previous one, with additional concepts added as the series progresses. Examples will start off easy with shorter scripts, and by the end of the series you'll be able to write more complex scripts that will actually come in handy while maintaining Linxu servers. In this episode, we'll take a look at variables.
Brand LPI Linux Essentials Course Available
Check out the new course on Udemy! ➜ learnlinux.link/lpi-course
➜ learnlinux.link/lpi-course
Check out the Linux Shop
In the official shop, you'll find Shirts, hats, stickers, bags and more!
➜ merch.learnlinux.tv
5% discount on LPI exam vouchers
After you finish Jay's new course, get 5% off an LPI exam voucher here:
➜ learnlinux.link/lpi-voucher
Become a Patron
Show your support for Learn Linux TV on Patreon and get access to exclusive perks!
➜ learnlinux.link/patron
Become a Channel Member
Show your support for Learn Linux TV here on KZfaq and get access to exclusive perks!
➜ learnlinux.link/member
Mastering Ubuntu Server: 4th Edition
Jay's latest book covers everything you need to know in order to master Ubuntu Server. It's available here:
➜ ubuntuserverbook.com
Linux Gear and Kits
Check out Jay's choice of hardware products, audio/video equipment, and more.
➜ learnlinux.link/amazon
Grab an awesome Pi-powered KVM
Support Learn Linux TV and grab yourself a TinyPilot KVM here:
➜ learnlinux.link/tinypilot
Note: Royalties and/or commission is earned from each of the above links
Time Codes
00:00 - Intro
00:52 - Declaring a variable in Bash
01:45 - How to reference a variable in Bash
06:25 - Using variables within Bash Scripts
16:44 - How to use the output of a command within a Bash Script
22:23 - How to view the environment variables within your Linux session
OTHER BASH SCRIPTING SERIES EPISODES
- Class 01 ➜ Introduction: linux.video/bash1
- Class 02 ➜ Hello World: linux.video/bash2
- Class 03 ➜ Variables: linux.video/bash3
- Class 04 ➜ Math Functions: linux.video/bash4
- Class 05 ➜ If Statements: linux.video/bash5
- Class 06 ➜ Exit Codes: linux.video/bash6
- Class 07 ➜ While Loops: linux.video/bash7
- Class 08 ➜ Universal Update Script: linux.video/bash8
- Class 09 ➜ For Loops: linux.video/bash9
- Class 10 ➜ Where To Store Your Scripts: linux.video/bash10
- Class 11 ➜ Data Streams: linux.video/bash11
- Class 12 ➜ Functions: linux.video/bash12
- Class 13 ➜ Case Statements: linux.video/bash13
- Class 14 ➜ Scheduling Jobs (Part 1): linux.video/bash14
- Class 15 ➜ Scheduling Jobs (Part 2): linux.video/bash15
- Class 16 ➜ Arguments: linux.video/bash16
- Class 17 ➜ Building a Backup Script: linux.video/bash17
- Class 18 ➜ Closing: linux.video/bash18
Full Courses from Learn Linux TV
• Linux Essentials Certification Workshop ➜ learnlinux.link/lpi-course
• Linux Crash Course series ➜ linux.video/cc
• Learn how to use tmux ➜ linux.video/tmux
• Learn how to use vim ➜ linux.video/vim
• Bash Scripting Series ➜ linux.video/bash
• Proxmox VE Cluster Full Course ➜ linux.video/pve
• Learn Ansible ➜ linux.video/ansible
Learn Linux TV on the Web
• Main site ➜ www.learnlinux.tv
• Community ➜ community.learnlinux.tv
• Enterprise Linux Security Podcast ➜ enterpriselinuxsecurity.show
• The Homelab Show Podcast ➜ thehomelab.show
• Content Ethics ➜ www.learnlinux.tv/content-ethics
• Request Assistance ➜ www.learnlinux.tv/request-ass...
Disclaimer
Learn Linux TV provides technical content that will hopefully be helpful to you and teach you something new. However, this content is provided without any warranty (expressed or implied). Learn Linux TV is not responsible for any damages that may arise from any use of this content. The person viewing Learn Linux TV's content is expected to follow their best judgement and to make their best decisions while working with any related technology. Always make sure you have written permission before working with any infrastructure. Also, be sure that you're compliant with all company rules, change control procedures, and local laws.
#linuxtutorial #linux #ubuntu

Пікірлер: 72
@brave.circassian77
@brave.circassian77 Ай бұрын
best linux teacher on youtube
@logger00
@logger00 Ай бұрын
very nice explotnation ,thanks bro best sireis of this topic
@ryanlee2546
@ryanlee2546 23 күн бұрын
Thank you so much for these great classes!!
@vincentlivera2948
@vincentlivera2948 29 күн бұрын
You are the best, Buddy. Thanks
@davey820051
@davey820051 Жыл бұрын
Excellent series. You've done a good job of making each installment easily digestible in terms of concepts covered and running time. Thank you.
@p5eudo883
@p5eudo883 Жыл бұрын
Great series. The intro is longer than my ADHD can cope with, so I skip ahead right away. But the presentation is fantastic.
@sridhartn83
@sridhartn83 10 ай бұрын
This is the best shell scripting tutorial I can find across the internet. well paced, explanation of every single term and concept and not just vaguely using it without an explanation to back it, thanks a lot for putting this together, I really appreciate for doing this.
@Akahatoo
@Akahatoo 4 ай бұрын
Awesome content, quite calming and with hands-on examples
@alonkadosh400
@alonkadosh400 6 ай бұрын
This series is so easy to understand and is perfect for beginners. Thank you!
@Elclaapo
@Elclaapo 5 ай бұрын
Great series! Really well done. The fact it is free is pure gold. Thanks a million Jay :)
@jessetello7033
@jessetello7033 7 ай бұрын
thank you so much for this series! its been so helpful for my class at university. I am excited to continue learning!
@071asadahbar4
@071asadahbar4 10 ай бұрын
Excellent series, this is the best shell scripting tutorial I can find across the internet.Thank you so much ! You are an excellent teacher
@Naposta77
@Naposta77 Жыл бұрын
This is a wonderful resource for linux beginners. Excellent!
@patrob3885
@patrob3885 Жыл бұрын
Thank you so much ! You are an excellent teacher ! I have learnt so much
@g-jalil6961
@g-jalil6961 Жыл бұрын
Brilliant series!
@Wespodcastz
@Wespodcastz Жыл бұрын
This guy is the best teacher alive..
@cristian.adragna
@cristian.adragna 4 ай бұрын
Bravo! Un corso ben organizzato! Well done!
@jonc5373
@jonc5373 6 ай бұрын
Brilliant video. Thank you!
@RajkoRuza
@RajkoRuza Жыл бұрын
Great series!
@barkhadibraahim1023
@barkhadibraahim1023 Ай бұрын
thanks so much
@faradhamadi
@faradhamadi 9 ай бұрын
Great work sir thanks for your useful information
@allahdadkhan8498
@allahdadkhan8498 3 ай бұрын
great job.
@Rithishrayen03
@Rithishrayen03 3 ай бұрын
Great sir
@HerrDerDrucker
@HerrDerDrucker 8 ай бұрын
You are best teacher ! Thank u so much homie !
@AlbandAquino
@AlbandAquino Жыл бұрын
I was about to leave a comment about the quotes (and how double quotes allows for variables replacement and single quote don't), but I'm glad I waited 👍🏼 Excellent video, as usual. Your channel is my Linux "cheat sheet" 😁
@cavenmasetla8740
@cavenmasetla8740 Жыл бұрын
When I heard your sad background story I knew this is the guy I have been looking for. I'm going to chill here until Im a senior Linux engineer. Thanks a million Sir
@chesterbelle
@chesterbelle Жыл бұрын
ty for the lesson your a great teacher
@jojobobbubble5688
@jojobobbubble5688 Жыл бұрын
This helped my wright much DRYer code. Thanks much!
@madrasrider
@madrasrider 22 күн бұрын
Good explanation
@rreuter18
@rreuter18 Жыл бұрын
Awesome Series.
@fabiobianchi3104
@fabiobianchi3104 9 ай бұрын
thanks for the class!!!
@DevOps691
@DevOps691 10 ай бұрын
thanks for this class.
@simonkalu
@simonkalu 7 ай бұрын
This is refreshing. thanks
@samiramir91samor78
@samiramir91samor78 Жыл бұрын
Sir thank you really great work
@JinSheng1990
@JinSheng1990 3 ай бұрын
very cool!
@rzbappy7213
@rzbappy7213 9 ай бұрын
awsome tutorial man
@vj1980
@vj1980 3 ай бұрын
Thank you so much
@codewithlamin
@codewithlamin Жыл бұрын
Great lecture
@franciscoromogaray3076
@franciscoromogaray3076 4 ай бұрын
another banger ma dude
@hamadej
@hamadej 11 ай бұрын
super useful tutorial
@fadidib8516
@fadidib8516 Жыл бұрын
from this video, i noticed that you follow patterns, a professional.
@VideosRichy
@VideosRichy 20 күн бұрын
thank you!
@nazimzhonmullabaev6622
@nazimzhonmullabaev6622 3 ай бұрын
Thx you man
@kainaatmakhani6550
@kainaatmakhani6550 Жыл бұрын
informative lecture
@burstfireno1617
@burstfireno1617 4 ай бұрын
Subbed! very cool channel
@rickgrimes47
@rickgrimes47 3 ай бұрын
Damn! You are the best teacher!
@CorporateDrone
@CorporateDrone 9 ай бұрын
amazing!
@peterjansen4826
@peterjansen4826 Жыл бұрын
Some people might wonder how you could use the $-sign in the echo command given that the $-sign is used to call a variable. Use the escape-character \ in front of it. This applies in general if you struggle to use a character in a command, like the space or slash.
@aKa55
@aKa55 8 ай бұрын
like SHELL was also a regular variable from the system. I wil have my Linux Essentials next week, so thank you very much for ur videos. sub!
@prateekbhardwaj9943
@prateekbhardwaj9943 Жыл бұрын
your workstation is interesting
@leonel_carrizo
@leonel_carrizo Жыл бұрын
thanks!
@oseaniic
@oseaniic 10 ай бұрын
appreciate it
@anass_lm9awd_bzf
@anass_lm9awd_bzf 6 ай бұрын
3tak lah sa7a habibi
@guilherme5094
@guilherme5094 Жыл бұрын
👍Nice!
@_nathan978
@_nathan978 5 ай бұрын
Another way to determine variables predefined in bash: Type the dollar sign ($) in the terminal and press tab
@TechRebel2008
@TechRebel2008 8 ай бұрын
i use kali linux... btw nice explanation bro
@haltutor8014
@haltutor8014 Жыл бұрын
thanks for this series. not sure why you had quotes around the age variable, tho. isn't that a number and not requiring quotes?
@josephchamness9915
@josephchamness9915 Жыл бұрын
Nice video series. I find scope vexing. I used to try updating my $PATH in a bash script and run into problems. Or creating a variable in 1 script and using it in a different 1.😅
@seshuyudansh7208
@seshuyudansh7208 Жыл бұрын
Thanks alot Jay seems im going to master the scripting which I never get interest to learn
@silentnight4618
@silentnight4618 Жыл бұрын
"A single quote may not occur between single quotes, even when preceded by a backslash." - bash manual
@manomite3544
@manomite3544 Жыл бұрын
I have two questions... 1) Can we camel case method to create variable names like myUsername instead of myUsername. 2) Is it possible to escape the single quote using back slash... Like 'I\'m jude $USER'
@GamerGeekDad
@GamerGeekDad 4 ай бұрын
Can you tell us what font you are using here? 😮
@anjanbora7943
@anjanbora7943 5 ай бұрын
Bash command==> 💋
@lance_c1323
@lance_c1323 Жыл бұрын
My Bookmark
@lance_c1323
@lance_c1323 Жыл бұрын
04-08-23 @ 1205AM 10:40
@hootiebubbabuddhabelly
@hootiebubbabuddhabelly Жыл бұрын
SOLVED! So, how does one restore bash, once one has trashed it somehow? I accidentally figured out how to reinstall bash, which, apparently, you can't do WITHOUT bash, ROFL, which is EXTREMELY annoying! BUT - you CAN log into the folder with the reinstall scripts AS ROOT, in nemo or, maybe some other file managers as well - not sur - THEN leave the file manager open as root and reinstall with the package manager GUI. I intended to switch the offending file from bash to sh and then change it back but when I went to change it back after FINALLY getting bash to reinstall with Synaptic, I discovered I'd failed to save the changes so, the only other thing it could have been was the fact that I was logged into the folder in the file manager as root. SOOO - got my terminal back, got bash, got everything updated, everything's working and I can go back to playing with bash scripts! I still don't know how I broke it in the first place so I reckon I'll find out, in pretty short order. But since reinstalling bash is so easy now, who cares?!?! WHEEEE! If you ever want to know how dependent you are on bash, just break it. I was over a week with no terminal and it 'bout drove me nuts. I couldn't even make a bootable flash drive without it! Couldn't update, install or reinstall anything and, of course, no terminal - though I did get an sh terminal at one point, but that didn't survive my attempts to repair bash so I was totally terminal-less. Thought I was going to have to reinstall and reharden everything which is precisely what I wanted a bash script for - "auto-hardening".
@Alpha_Sadigh
@Alpha_Sadigh Жыл бұрын
☯🙏
@chrisrodriguez8026
@chrisrodriguez8026 8 ай бұрын
can you make a new file and instead of reusing the old one. It makes it easier to look back at what you have done.
@hasanferoz2364
@hasanferoz2364 2 ай бұрын
For New Bash Scripters: do not leave spaces between myname="Jay" in linux if you wrote myname = "Jay" linux will think it as a command and display unknown command error...
@Mitology
@Mitology Жыл бұрын
Thank you! Please subscribe and like the video, free education is AWESOME!
Bash Scripting on Linux (The Complete Guide) Class 04 - Basic Math
6:07
New Linux User: 10 Things I Wish I Knew When I First Started
23:31
Learn Linux TV
Рет қаралды 404 М.
WHY THROW CHIPS IN THE TRASH?🤪
00:18
JULI_PROETO
Рет қаралды 6 МЛН
Increíble final 😱
00:37
Juan De Dios Pantoja 2
Рет қаралды 15 МЛН
Would you like a delicious big mooncake? #shorts#Mooncake #China #Chinesefood
00:30
Apple WWDC 2024: AI, iOS 18 and More in Less than Six Minutes | WSJ
5:20
The Wall Street Journal
Рет қаралды 23 М.
Bash Scripting on Linux (The Complete Guide) Class 05 - If Statements
31:43
Why Linux is better for (most) developers!
14:59
The Linux Experiment
Рет қаралды 461 М.
18 Commands That Will Change The Way You Use Linux Forever
29:50
Akamai Developer
Рет қаралды 1,2 МЛН
Linux Crash Course - The sed Command
15:25
Learn Linux TV
Рет қаралды 114 М.
BASH scripting will change your life
14:18
NetworkChuck
Рет қаралды 994 М.
60 Linux Commands you NEED to know (in 10 minutes)
10:50
NetworkChuck
Рет қаралды 1,3 МЛН
Become a bash scripting pro - full course
36:00
CODE IS EVERYTHING
Рет қаралды 39 М.