Understanding Shells: Linux Sub Shells vs Child Shells
ฝัง
- เผยแพร่เมื่อ 18 ก.ย. 2024
- In this video we look at comparing Linux sub shells vs child shells . Understanding the differences with sub shells and child shells and why we use each. We look at what is and isn't inherited when a new shell is created and how you know the type of shell you are running.
Additionally you can find my video courses on Pluralsight: pluralsight.com... and take time to see my own site www.theurbanpen...
~-~~-~~~-~~-~
Please watch: "RHCSA 9 Working With Podman Containers"
• How To Use Podman Cont...
~-~~-~~~-~~-~
another common usage is that when you use cd to loop through some directories, you don't need to cd back if you run each iteration as subshell
Nice explanation! Thank you.
Awesome as always. Thanks!
I love content like this, than you very much!
thank you
Thanks for a great video!
Thank you
8:15 - Cheeky bastard
Hello Urban Penguin, I like your content. I am an entry-intermediate Linux engineer currently and looking at courses/certifiaction to develop my career.
Which certification would you recommend me pursuing first ? I've been looking at Comptia Linux + XK0-005 and LPI Essentials or LPIC-1
Linux Essentials is a great start. You may well be at that level already. It is the cheapest also. Then look at CompTIA. A single exam rather than two exams with LPIC and is bang up to date
@@theurbanpenguin Thank you
at 6:11 the variable FRUIT is first expanded by the parent shell and the whole subshell is executed. the last echo in the the subshell is 'echo apple' and not echo $FRUIT. The shell bash do the variable expansion before the process expansion. So the when you say the variable are automticly exported in subshell, is not the right exemple...
No it is not exported. It is a cloned shell. As such is has local variables and aliases. We do not cover exporting here as it does not apply
yes, not exported. but you said is availlable... wath i am trying to say (sorry for my poor english), is that, the variable in your example is nerver used by subshell, because of the precedent of expansion in bash. it is the parent shell that do the expension before executing all in ()... hope I am more clear. Beside thath, nice video
Try to run this
a=1; (a=2; echo $a)
It prints 2 instead of 1
that being the case, (echo $BASH_SUBSHELL) should print out the same result as that in current shell, but it actually does print the correct level of subshell. i'm confused