POSIX → Portable Operating System IX

series of specifications since 1980

Shell

Shell can operate as...

> echo hello
hello
> echo echo hello > echo-hello # put "echo hello" into the file echo-hello
> sh echo-hello # execute the file echo-hello using sh
hello
> sh -c 'echo goodbye' # treat the content as input in sh
goodbye
> echo echo solong | sh # put "echo solong" to sh and make it execute 
solong

Side note: what's different about files and buffers?

Files: Live in file system, persistent

Emacs Buffers: Live within Emacs RAM

Advantage: 1) Performance 2) Functionality

In additional to the commands in the /usr/bin, there are also built in commands like exit and jobs and they have higher precedence

What will happen when 2 buffers are modifying the same file at the same time?

Most files do not correspond to buffers, and many buffers do not correspond to files.

So can 2 buffers be associate to 1 file? Yes, but not recommended

But 2 files, one buffer? No

Back to Shell

To talk about cd , we need first talk about the POSIX File System

Directory: partial function from file name components to file

File name component: string with no '/' or '\0' in it

The overall structure is like a tree