A typed word had ".sbx" pasted on the end of it before anything went looking, which is why "notes.txt" sent the shell after a notes.txt.sbx that was never going to exist, and why a script could only be started with "do". The extension was what made a file reachable by name. Now the word as typed is asked for first and the word with the extension on it only after that misses. What comes back is dispatched on what is inside it: SBEX loads and starts, "#!" is read as lines. The loader already refuses anything that is not SBEX and the script reader already refuses anything without the shebang, so the two kinds of runnable file turn each other away and neither has to know the other exists. The suffix can only ever be a second guess, so a file that is really there always beats one that would have to be invented and every program already on a disk still starts by the short name people type for it. It costs a second walk of each directory when a word is not found in it. Tab completion offers a file under the name it actually has, and the suffix stripper is gone: a first word can now be any file at all, and offering only the ones ending .sbx would hide the scripts. The video capture windows moved out a hundred thousand cycles, because starting Lander now walks four names where it walked two. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E2JrLzFvuFX9fgi1LDRjrW
61 lines
1.7 KiB
Plaintext
61 lines
1.7 KiB
Plaintext
CosmOS
|
|
> Say hello there
|
|
it says: hello there
|
|
finished
|
|
> Say.sbx spelled out in full
|
|
it says: spelled out in full
|
|
finished
|
|
> run once more
|
|
it says: once more
|
|
finished
|
|
> dir
|
|
Say.sbx 156
|
|
dir.sbx 156
|
|
Greet 156
|
|
notes.txt 21
|
|
notes.sbx 21
|
|
hello.sh 38
|
|
Apps <dir>
|
|
6 files, 1 directory
|
|
> Greet a program with no extension
|
|
it says: a program with no extension
|
|
finished
|
|
> hello.sh
|
|
> echo a script, started by its name
|
|
a script, started by its name
|
|
> away.sh
|
|
> echo a script from the system place
|
|
a script from the system place
|
|
> notes
|
|
that is not a program or a script: notes
|
|
> notes.sbx
|
|
that is not a program or a script: notes.sbx
|
|
> notes.txt
|
|
that is not a program or a script: notes.txt
|
|
> nosuchprogram
|
|
I do not know: nosuchprogram
|
|
> abcdefghijklmnopqr
|
|
I do not know: abcdefghijklmnopqr
|
|
> abcdefghijklmnopqrs
|
|
I do not know: abcdefghijklmnopqrs
|
|
> help
|
|
dir list what is on the disk
|
|
load <file> read a program off the disk
|
|
run [words] start what was loaded, and tell it those words
|
|
<name> [words] look where you are and then in /Apps, and start that
|
|
cd [path] go to a directory, or to the root with nothing after it
|
|
mkdir <path> make a directory
|
|
rmdir <path> remove an empty one
|
|
do <file> run the lines in a file, which must start with #!
|
|
echo [words] say them
|
|
clear empty the screen
|
|
delete <file> take it off the disk
|
|
rename <file> <to> call it something else
|
|
monitor look at memory, change it, and jump into it
|
|
help this
|
|
exit stop, or leave the monitor if you are in it
|
|
> exit
|
|
halted
|
|
Execution halted.
|
|
[exit 0]
|