Тёмный
No video :(

Bash Scripting 4 -- How Bash Scripts Work 

tutoriaLinux
Подписаться 208 тыс.
Просмотров 65 тыс.
50% 1

Опубликовано:

 

26 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 34   
@Czarmzy
@Czarmzy 9 лет назад
Your vids are pure gold especially these series, please continue.
@tutoriaLinux
@tutoriaLinux 9 лет назад
Dawid Cz Thanks! I know I've been slacking on this series, I'll put it on my to-do list.
@miteshshah918
@miteshshah918 9 лет назад
tutoriaLinux These videos are great. Please increase the priority of video #5 :D)
@mevlentips9844
@mevlentips9844 2 года назад
@@tutoriaLinux one question?Does bash have a data type or it's untyped language.
@MikeDawson1
@MikeDawson1 8 лет назад
This is the most amount of information I've learned inside of 12 minutes in a long time. Thank you!
@samuraijack5919
@samuraijack5919 4 года назад
Bash Scripting 4 -- How Bash Scripts Work My notes: What command do you use to find out where the Bash binary is? (hint: The first thing you declared in every script) which bash (will output /bin/bash or other location it is stored in) - When you create a script, why should you use the file ending .sh? (even though file endings won't matter to the shell?) Because the it will be easier for the people who come after you to understand what it is - Return values can be anywhere between 0 through.... ..255 - When you use 'exit' at the end by itself, what will the shell do? It will look for the last item that was called and will return that as the program's return value (as long as it returns 0/has no errors) - When you use 'exit $?', what are you doing in your program? You are showing that you are intentionally exiting and telling the program to output the last item that was called as the output - When you execute a file, what permission do you need to make sure that you have? execute (use chmod on the file to allow execution of it) - Running a program in the shell: Why should you use: 'source helloworld.sh' rather than 'bash helloworld.sh' ? Because you will have access to the variables and information stored inside the script in your current bash session (makes it easier because you won't have to run things over and over again to modify certain elements) - What is the difference between these two: source helloworld.sh . helloworld.sh There is no difference, both are interchangeable - Tell me if there is anything that I missed or got wrong. Have a safe and productive day.
@MrWARRIORMONKS
@MrWARRIORMONKS 7 лет назад
Excellent series, taught in a clear, simple and entertaining way by a good teacher. Thank you!!!
@davidsun9026
@davidsun9026 8 лет назад
thank you so much for making these series.
@linuxmq3945
@linuxmq3945 9 лет назад
Hi, Sorry ignore my question. Just watching a few seconds more gave me the answer. It is at the kernel level as you said. I never knew that before! Thanks
@mattb5639
@mattb5639 8 лет назад
Dave, awesome video here, really accessible. Any chance on a follow up/continuation of this series in the near future?
@samdavepollard
@samdavepollard 7 лет назад
Very useful. Thank You for sharing your knowledge.
@elnurvalikhanli6783
@elnurvalikhanli6783 2 года назад
your reactions are hilarious :D
@aayushmaurya2223
@aayushmaurya2223 4 года назад
Wanted to know what if changing the $message variable after sourcing the script would actually change the variable in the script or just in the shell session. Turns out it just changes the value of the variable in the login shell and not the script. Sourcing the script again will reset $message variable in the login shell to the value specified in the script. Great stuff!!
@ozanh
@ozanh 7 лет назад
almost better than we dream 😄
@kgaurav8494
@kgaurav8494 10 месяцев назад
Hey, I was following along fine but for some reason now I'm not able to execute anything. What have I messed up. Sorry, user is not allowed to execute '/bin/bash' as root on hostname
@noahark4832
@noahark4832 2 года назад
What is the difference between /bin/bash and /usr/bin/bash? My output on which bash shows /usr/bin/bash.
@tutoriaLinux
@tutoriaLinux 2 года назад
It just means that your bash program (binary) is installed somewhere slightly different on your system.
@aekraj5713
@aekraj5713 7 лет назад
Hey, thank you for this vedio. in this video 1 is terminal and another is which program ? could you tell me? (i just try to learn about Linux)
@linuxmq3945
@linuxmq3945 9 лет назад
Very nice videos. Something that I never understood. Why "#!/bin/bash" is so important in the first line of a script if the "#" starts a "comment line" that is "ignored"? What is the process behind the scripting language that requires that specific line? I would understand if there wasn't any "#" first. Thanks
@jawbone2000
@jawbone2000 9 лет назад
+linuxmq when your machine executes a script, it is read both by the os and the particular programming language that does the executing. the os comes first, reads the first line, sees the she-bang, and sends the file to the particular programming language binary, the programming language sees the # and presumes that the particular line is useless, just another comment.
@rebekamendonca3841
@rebekamendonca3841 7 лет назад
how to exit in the bash -4.3 ?Already tried exit did not work
@jimkats1
@jimkats1 6 лет назад
I just did a test and found out that only "./test.sh" reads the interpreter in the 1st line. I found this by mistaken the bash's path. All other 3 options, that is ". test.sh", "source test.sh" and "bash test.sh" have returned the expected output, whilst the 4th one returned "bash: ./test.sh: bin/bash: bad interpreter: No such file or directory"
@vincentcrescente6548
@vincentcrescente6548 4 года назад
Got the same here you go. stackoverflow.com/questions/14219092/bash-script-and-bin-bashm-bad-interpreter-no-such-file-or-directory
@humbertoojeda6937
@humbertoojeda6937 6 лет назад
the '$?' was a bit confusing. some additional explanation/examples would have helped, but besides that, pretty good
@tutoriaLinux
@tutoriaLinux 6 лет назад
Thanks; I could have explained that better. Just remember that it shows you the exit status of the last command. If you play with it in the shell it'll make sense quickly.
@amoslevin2895
@amoslevin2895 9 лет назад
nice
@ahmadel-komey8977
@ahmadel-komey8977 6 лет назад
I prefer to use vscode over sublime.
@techjeff6227
@techjeff6227 5 лет назад
9:05 :')
@EndrChe
@EndrChe 3 года назад
Ahh, yes. The shebang. The more elusive cousin to the slightly lesser known “exclamuestion” mark. All rights reserved, patent pending.
@caseywinters3021
@caseywinters3021 3 года назад
I hope you’ve left fb and Twitter by now
@gyan2664
@gyan2664 8 лет назад
u take really a lot time to tell simple things otherwise ur tutorials are good .....
@loganparrette2429
@loganparrette2429 7 лет назад
Because he is making sure the concepts are driven home. Do take the time to read the description and titles of playlists before you comment items like this. This video is located in a playlist titled "The Linux Basics Course". Keyword there is "Basic"
@JohnMarkIsaacMadison
@JohnMarkIsaacMadison 4 года назад
I've written a lot of bash scripts over the years. But these basics definitely help fill the gaps in my knowledge.
@nagiostest2460
@nagiostest2460 6 лет назад
If you write a script for the bash, you should call it .bash
Далее
Bash Scripting 5 -- Arguments
7:51
Просмотров 74 тыс.
Write Your Own Bash Scripts for Automation [Tutorial]
16:35
100+ Linux Things you Need to Know
12:23
Просмотров 1 млн
Bash Scripting 3 -- Variables and Quoting
9:47
Просмотров 60 тыс.
Become a bash scripting pro - full course
36:00
Просмотров 52 тыс.
Learning Awk Is Essential For Linux Users
20:02
Просмотров 295 тыс.
How Do BASH Scripts Even Work?!?
12:27
Просмотров 4,4 тыс.
Compilers, How They Work, And Writing Them From Scratch
23:53
How Do Linux Kernel Drivers Work? - Learning Resource
17:02
7 Essential Command Line Tools (2022)
9:12
Просмотров 209 тыс.
I forced EVERYONE to use Linux
22:59
Просмотров 457 тыс.