Home

Translating Shell to Oil, Part 2

2017-02-06

(B) more/repo.sh from Aboriginal Linux

(a) Subshell is shell {}. MISUSE! I have seen this in 4-5 different projects. It seems that subshells are misused as often as they are used correctly!

Where did I note this?

EVERY INSTANCE OF $(( Is s MISUSE OF SUBSHELL.

SYNTAX MATTERS.

About FIFTY PERCENT OF SUBSHELLS SHOULD BE COMMAND GROUPS!

http://www.oilshell.org/blog/2016/11/18.html

TODO: Point to 99 fizzbuzz in Bash.

do { } vs subshell {}

(C) reboot from /etc/init.d

(a) case vs matchstr. matchstr vs. match -- because oil will have types.

(a) source vs . -- we want verbose functions. Rely on auto-completion.

(b) GLOBAL variables. Need to work this out a l ittle more

(c) File descriptors. !2.

< and > are UNARY PREFIX as well as binary operators.

TODO: BLOG POST: Redirects are not binary operators.

(D) console-setup from /etc/init.d

(a) $ifsjoin()

ANOTHER BAD SUBSHELL.

Main correct use of subshells: ( cd ~/git ; find . ; cd ~/hg )

Oil will have:

cd ~/git { find . }

Syntax Examples

Make note of:

TODO: "source" instead of . - proper modules might be encouraged, make the code faster


Discuss this post on Reddit