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, 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, 11:15am, Alastair H.
├─ reply 1   Tue 9th Jun, 4:26pm, David M.
├─ reply 2   Tue 9th Jun, 4:36pm, David M.
├─ reply 3   Tue 9th Jun, 5:15pm, Christopher M.
├─ reply 4   Tue 9th Jun, 5:26pm, David M.
├─ reply 5   Tue 9th Jun, 7:50pm, Lee dB.
├─ reply 6   Tue 9th Jun, 9:01pm, Alastair H.  O.P.
├─ THIS   Wed 10th Jun, 4:11am, Christopher M.
├─ reply 8   Wed 10th Jun, 4:12am, Christopher M.
├─ reply 9   Wed 10th Jun, 9:33am, Lee dB.
├─ reply 10   Wed 10th Jun, 3:28pm, Christopher M.
├─ reply 11   Wed 10th Jun, 6:39pm, Lee dB.
├─ reply 12   Fri 12th Jun, 3:51am, Christopher M.
└─ reply 13   Fri 12th Jun, 10:31am, Lee dB.
This Page

Program written by: [email protected]
Feedback welcome
Last modified:  3:57pm Aug 06 2020