Add the programs ␀ and pack
[minish.git] / Devember / log13.txt
blob795ddc099b004e491dff0d1c5ccf608855b3da58
1 Call realloc() to double the size,
2 or at least to multiply it by a constant factor.
3 It is common wisdom among programmers, and it even works!
5 I discovered minish supports relative path, because execv() does.
7 I have added what I consider the killer feature of minish:
8 command substitution.
9 Many shells do it, but minish, in my opinion, does it right.
10 If a command contains parentheses,
11 what is inside is executed and its output substitutes it.
13 Let us suppose there is a program named “echo” in the current directory
14 that outputs its arguments separated by ␀.
15 Input                                   Output (I have tested it!)
16 ./echo␀hello                            hello
17 ./echo␀./echo␀hello                     ./echo␀hello
18 ./echo␀(./echo␀hello)                   hello
19 ./echo␀(./echo␀hello) (./echo␀world)    hello world
20 ./echo␀h(./echo␀ell)o␀world             hello␀world
21 (./echo␀./echo␀hello)                   hello
23 Splicing is automatic:
24 if the output of the substituted command contains ␀,
25 it is automatically separated into multiple words.
26 This is always the desired behavior,
27 because ␀ cannot appear inside a word.
29 There is a subtle difference between using command substitution
30 and typing the command yourself:
31 the special characters “(”, “)”, and newline
32 lose their special meaning.
33 This is by design and it is very important. I will show you tomorrow.
35 Enough for today.
37 Suggested readings:
38 https://computerworld.com.au/article/279011/
39 https://fishshell.com/docs/current/design.html
40 https://elvish.io/ref/philosophy.html