Understanding Shells: Linux Sub Shells vs Child Shells

Поділитися
Вставка
  • Опубліковано 18 вер 2024

КОМЕНТАРІ • 17

  • @Klinoklaz
    @Klinoklaz 6 місяців тому +1

    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

  • @SO-dl2pv
    @SO-dl2pv Рік тому +2

    Nice explanation! Thank you.

  • @alx8439
    @alx8439 11 місяців тому

    Awesome as always. Thanks!

  • @fraternitas5117
    @fraternitas5117 Рік тому

    I love content like this, than you very much!

  • @jankraus5525
    @jankraus5525 Рік тому

    Thanks for a great video!

  • @copperchatter6890
    @copperchatter6890 11 місяців тому

    8:15 - Cheeky bastard

  • @humblefox23
    @humblefox23 Рік тому

    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

    • @theurbanpenguin
      @theurbanpenguin  Рік тому +4

      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

    • @humblefox23
      @humblefox23 Рік тому

      @@theurbanpenguin Thank you

  • @sotecluxan4221
    @sotecluxan4221 Рік тому

  • @topklean
    @topklean Рік тому

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

    • @theurbanpenguin
      @theurbanpenguin  Рік тому

      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

    • @topklean
      @topklean Рік тому

      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

    • @cubernetes
      @cubernetes 7 місяців тому

      Try to run this
      a=1; (a=2; echo $a)
      It prints 2 instead of 1

    • @Klinoklaz
      @Klinoklaz 6 місяців тому

      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