Faculty of Engineering and Mathematical Sciences 
Not logged in (login)


This forum is provided to promote discussion amongst students enrolled in Open Source Tools and Scripting (CITS4407).
RSS cloud
Jump to:

lec # wk 10 File Attributes - Square Bracket command external or internal

1 of 390 articles shown, currently no other people reading this forum.
From: Christopher M.
Date: Wed 10th Jun 2020, 4:11am


"Lee de Byl" <10*0*8*[email protected]*u*e*t*u*a*e*u*a*> wrote:

> Hmmm, good mock question. I’m just testing my understanding here, but cd doesn’t strictly 
> have to be a shell built-in, as long as there is some mechanism for CD to communicate with 
> the shell? i.e there is no fundamental need for cd to not be external, as long as bash was 
> modified to communicate somehow with the cd external?

Today, 'cd' has to be internal to the shell, so that it can change the shell (process's) environment.  
Today's there no way for one process (such as child of a shell) to change the environment of another 
process - an external 'cd' command could change *its* working directory, but not that of its parent.

Way back in v6 Unix, mid-seventies, there was a small number of external commands that could modify where 
a shell would next read from a shellscript - enabling the external 'if', 'exit', and 'goto' commands:


Interesting stuff, but not missed by many.

Related articles

lec # wk 10 File Attributes - Square Bracket command external or internal (all 14) RSS
├─ original   Tue 9th Jun 2020, 11:15am, Alastair H.
├─ reply 1   Tue 9th Jun 2020, 4:26pm, David M.
├─ reply 2   Tue 9th Jun 2020, 4:36pm, David M.
├─ reply 3   Tue 9th Jun 2020, 5:15pm, Christopher M.
├─ reply 4   Tue 9th Jun 2020, 5:26pm, David M.
├─ reply 5   Tue 9th Jun 2020, 7:50pm, Lee dB.
├─ reply 6   Tue 9th Jun 2020, 9:01pm, Alastair H.  O.P.
├─ THIS   Wed 10th Jun 2020, 4:11am, Christopher M.
├─ reply 8   Wed 10th Jun 2020, 4:12am, Christopher M.
├─ reply 9   Wed 10th Jun 2020, 9:33am, Lee dB.
├─ reply 10   Wed 10th Jun 2020, 3:28pm, Christopher M.
├─ reply 11   Wed 10th Jun 2020, 6:39pm, Lee dB.
├─ reply 12   Fri 12th Jun 2020, 3:51am, Christopher M.
└─ reply 13   Fri 12th Jun 2020, 10:31am, Lee dB.
This Page

Program written by: [email protected]
Feedback welcome
Last modified: 11:27am Sep 21 2020