Make programs to escape the special characters
[minish.git] / Devember / log14.txt
blob88524e08ee96294176dd685172663448f06cf057
1 There are three special characters in minish: “(”, “)”, and newline.
2 The parentheses delimit command substitution;
3 the newline ends a command.
5 All special characters lose their special meaning
6 when they are the result of a command substitution.
7 This can be used as a form of escape.
8 I have made three programs,
9 “open parenthesis”, “close parenthesis”, and “newline”,
10 that output a special character each.
11 To run a program called “program (v2)”,
12 you can type “program (open parenthesis)v2(close parenthesis)”.
14 make stopped working, because some files to be compiled contain spaces.
15 Maybe there is a way to work around it,
16 but I have decided to replace the makefile with a shell script
17 for sh, the POSIX shell.
18 As make already used sh,
19 there are strictly less dependencies to build minish.
20 minish used GNU make, not POSIX make,
21 but I want any POSIX system that can compile C11 programs
22 to be able to build minish.
24 The script build.sh [args...] executes [args...]
25 on each “.c” file in src/.
26 To compile using gcc and the option “-O3”,
27 run “./build.sh gcc -O3”.
28 Executing build.sh without arguments compiles using
29 “clang -DNDEBUG -ferror-limit=1 -flto -fvisibility=hidden
30 -march=native -O3 -s -static -std=c11 -Werror -Weverything
31 -Wno-disabled-macro-expansion -Wno-reserved-id-macro”.
33 Unlike the makefile, build.sh cannot be used to clean the object files,
34 but each one of them is placed in bin/,
35 so you can run “rm -f -r bin/” to delete it.
37 Enough for today.
39 Suggested reading:
40 https://www.etalabs.net/sh_tricks.html