Commit Graph

216 Commits

Author SHA1 Message Date
Timothy Sample 50473ac9d4 Add copyright sign to headers.
* gash/built-ins/*, gash/environment.scm, gash/eval.scm,
gash/lexer.scm, gash/parser.scm, gash/repl.scm, gash/word.scm,
tests/unit/*, tools/coverage.in: Add copyright sign to headers.
2019-05-20 01:18:22 -04:00
Jan Nieuwenhuizen 9f57723fb6 Make 'set -x' print commands.
* gash/shell.scm (sh:exec-let): Respect the 'xtrace' option.
2019-05-20 01:18:22 -04:00
Jan Nieuwenhuizen 2e4e078975 Fix some environment-dependent tests.
* gash/environment.scm (initial-variables): Add 'SHELL' and 'SHELLOPTS'.
* tests/100-cd.sh, tests/100-cd.stdout: Use '/tmp' instead of '/bin'.
* tests/50-redirect-in-out.sh, tests/50-redirect-space.sh,
tests/50-redirect.sh: Use '/tmp' and PID for temporary files.
* tests/50-redirect-sed.sh: Make sure 'DESTDIR' is unset and use
'/bin/GASH' in place of '/bin/gash'.
* tests/50-redirect-sed.stdout, tests/data/diff.scm: Use '/bin/GASH' in
place of '/bin/gash'.
* Makefile.am (FULL_TESTS): Add tests/50-redirect-sed.sh,
tests/50-redirect-space.sh, and tests/100-cd.sh; remove
tests/50-redirect-merge.sh.
(BROKEN_TESTS): Remove tests/10-if-redirect.sh,
tests/50-redirect-sed.sh, tests/50-redirect-space.sh, and
tests/100-cd.sh; add tests/50-redirect-merge.sh.

Co-authored-by: Timothy Sample <samplet@ngyro.com>
2019-05-20 01:18:07 -04:00
Timothy Sample e87f351f3e Add missing copyright headers.
* gash/gash.scm, gash/grammar.scm, gash/io.scm, gash/job.scm,
gash/pipe.scm, gash/script.scm: Add missing copyright header.

Co-authored-by: Jan Nieuwenhuizen <janneke@gnu.org>
2019-05-20 01:17:48 -04:00
Timothy Sample 1bd92e2893 Remove (almost) all references to Geesh.
gash/environment.scm: Remove file.
geesh/*: Move these files into the 'gash' folder and replace all
instances of the word 'geesh'.
scripts/geesh.in: Remove file.
HACKING, INSTALL, Makefile.am, configure.ac, guix.scm,
tests/bootstrap/bash-without-bash.scm, tests/spec/Makefile.am,
tests/spec/check-spec, tests/spec/oil.scm, tests/unit/*,
tools/coverage.in: Replace all instances of the word 'geesh'.

Co-authored-by: Jan Nieuwenhuizen <janneke@gnu.org>
2019-05-20 01:17:40 -04:00
Timothy Sample f387269c0b Only use readline for TTYs.
* gash/gash.scm: Hide the readline interface behind a check for
'isatty?', and default to just running the plain REPL.
2019-05-20 01:17:40 -04:00
Jan Nieuwenhuizen 7fcfe66407 Add the 'command' built-in.
* geesh/built-ins/command.scm: New file.
* Makefile.am: Add it.
* geesh/built-ins.scm (*built-ins*): Add 'command'.

Co-authored-by: Timothy Sample <samplet@ngyro.com>
2019-05-20 01:17:30 -04:00
Jan Nieuwenhuizen cf5611f6d4 Replace geesh script with gash.
* geesh/repl.scm (run-repl): Add optional parse? parameter.
* gash/gash.scm (main): Rewrite to use Geesh parser and evaluator.
* scripts/geesh.in: Remove.
* Makefile.am: Remove scripts/geesh; adjust XFAIL_TESTS.
* .gitignore: Update.

Co-authored-by: Timothy Sample <samplet@ngyro.com>
2019-05-20 01:17:14 -04:00
Timothy Sample 171796317f Remove external commands.
* gash/bournish-commands.scm, gash/commands/*, gash/compress.scm,
gash/guix-utils.scm, gash/lzw.scm, gash/ustar.scm: Delete files.
* gash/builtins.scm, gash/gash.scm, gash/script.scm: Remove references
to deleted modules.
* tests/100-basename-*, tests/100-dirname-*, tests/100-sed-*,
tests/100-tar-*, tests/100-tr-*: Delete files.
* Makefile.am: Remove deleted modules and tests.
2019-05-16 10:49:38 -04:00
Timothy Sample bbcb78de14 Use built-in compress without an external file.
When the system does not provide a compress executable, we use our
own.  Before, this was done by installing an executable named
'compress' along with Gash.  This commit allows the compressed-port
functions to use our built-in compress without needing an external
executable.

* gash/config.scm.in (exec-internal-compress): New function.
(%compress): Fall back to it on systems without compress.
* gash/guix-utils.scm (filtered-port, filtered-output-port): When the
given command list begins with a procedure, apply it to its arguments
instead of using execl.
2019-01-12 11:42:26 -05:00
Timothy Sample 35444457f8 Remove unused variable from Gash config.
* gash/config.scm.in (%commands): Remove variable.
2019-01-12 11:42:17 -05:00
Timothy Sample 1cda08dd4a sed: Replace blank regexes with the last regex. 2018-12-11 13:13:46 -05:00
Timothy Sample 7aa7a883e0 sed: Add basic support for script files. 2018-12-11 13:13:46 -05:00
Timothy Sample 489f092131 sed: Add quit function. 2018-12-11 13:13:46 -05:00
Timothy Sample 5be7ed331d sed: Support command lists. 2018-12-11 13:13:46 -05:00
Timothy Sample 1302c8bf28 sed: Support single pattern addresses. 2018-12-11 13:13:46 -05:00
Timothy Sample 194c098ab7 sed: Fully parse commands before processing them. 2018-12-11 13:12:45 -05:00
Jan Nieuwenhuizen 8757ab67fb basename: fix /, add autoconf basename, dirname tests. 2018-12-09 04:13:27 +01:00
Jan Nieuwenhuizen 5b7f85aa3d Fix [, use \[ in tests. 2018-12-04 21:00:47 +01:00
Jan Nieuwenhuizen 179ae8cddd grammar: Support \[ builtin. 2018-12-04 19:17:39 +01:00
Jan Nieuwenhuizen 1ce8250029 set: Ignore set -o, set +o. 2018-12-04 19:17:39 +01:00
Jan Nieuwenhuizen 42d52d1a70 tar: Support extracting of read-only archives. 2018-12-04 10:13:45 +01:00
Jan Nieuwenhuizen 53fe775de9 chmod: Recurse also chmod's directories. 2018-12-04 10:10:05 +01:00
Jan Nieuwenhuizen f7617fce47 builtins: test: Fix a = b. 2018-12-03 21:01:37 +01:00
Jan Nieuwenhuizen d4f58ffa19 test: 04-word-at-word. 2018-12-02 09:51:57 +01:00
Jan Nieuwenhuizen 39761c0087 test: 04-word-at. 2018-12-02 09:51:57 +01:00
Jan Nieuwenhuizen 632295fa18 fix: 100-sed-fooRbar. 2018-12-02 09:03:02 +01:00
Jan Nieuwenhuizen f5bc1d45c4 fix: 50-redirect-in-out. 2018-12-02 09:03:02 +01:00
Jan Nieuwenhuizen a043f9ef09 tr: New builtin.
* gash/commands/tr.scm: New file.
* gash/bournish-commands.scm: Use it.
* build-aux/build-guile.sh: Compile it.
* configure: Wrap it.
* .gitignore: Ignore it.
2018-12-02 09:03:02 +01:00
Jan Nieuwenhuizen 353af765eb cp: Support -f, --force. 2018-12-02 09:03:02 +01:00
Jan Nieuwenhuizen 0679cf9903 mv: Support -f, --force (by ignoring it). 2018-12-02 09:03:02 +01:00
Jan Nieuwenhuizen 73ecccef1e fix 01-script-$@. 2018-12-02 09:03:02 +01:00
Jan Nieuwenhuizen 1f0a7674d9 fix 01-script-$#. 2018-12-02 09:03:02 +01:00
Jan Nieuwenhuizen d5c94e75dd parse [ .. ] into plain command. fixes 10-if-bracket-false, 100-bracket-file. 2018-12-02 06:56:17 +01:00
Jan Nieuwenhuizen 0a09ab114a mv: New builtin.
* gash/commands/mv.scm: New file.
* gash/bournish-commands.scm: Use it.
* build-aux/build-guile.sh: Compile it.
* configure: Wrap it.
* .gitignore: Ignore it.
2018-11-30 12:38:24 +01:00
Jan Nieuwenhuizen 1162f37d19 test: 07-variable-or-empty. 2018-11-25 11:53:29 +01:00
Jan Nieuwenhuizen 7f6b88c43b implement shift. 2018-11-25 08:46:10 +01:00
Jan Nieuwenhuizen cb05054006 fix parsing of 07-variable-or-doublequete.sh. 2018-11-24 13:10:38 +01:00
Jan Nieuwenhuizen 9ac8140cf4 test: 07-variable-or-doublequete.sh: New failing parse test. 2018-11-24 12:57:07 +01:00
Jan Nieuwenhuizen b2f5004eb6 01-script-$0.sh, 01-script-$@.sh: add test and fix. 2018-11-24 12:25:24 +01:00
Jan Nieuwenhuizen f81b526bd0 fix and test cd builtin. 2018-11-24 11:32:33 +01:00
Jan Nieuwenhuizen 58d1627b08 fix 60-function.sh. 2018-11-24 11:12:44 +01:00
Jan Nieuwenhuizen 43f79811aa fix 07-variable-or-variable.sh. 2018-11-24 10:55:24 +01:00
Jan Nieuwenhuizen bdbc29e448 transform: reduce simple commands...WIP 2018-11-17 20:08:17 +01:00
Jan Nieuwenhuizen 74454c2156 transform: handle ./source. 2018-11-17 19:27:51 +01:00
Jan Nieuwenhuizen 9d1ed9ef57 transform: if-clause->if. 2018-11-17 19:27:51 +01:00
Jan Nieuwenhuizen df73d5421f transform: translate script to begin or command. 2018-11-17 08:46:39 +01:00
Jan Nieuwenhuizen b89ca17134 transform: rewrite io-redirection. 2018-11-17 08:42:54 +01:00
Jan Nieuwenhuizen 2dc0a56ff9 guix: replace recipe with guile-only (bootstrappable) build. 2018-11-16 08:03:58 +01:00
Rutger van Beusekom d36ee815df variable-regex: fix 70-*.sh 2018-11-16 00:24:17 +01:00