Commit Graph

30 Commits

Author SHA1 Message Date
Jan Nieuwenhuizen 7f6b88c43b implement shift. 2018-11-25 08:46:10 +01:00
Jan Nieuwenhuizen f81b526bd0 fix and test cd builtin. 2018-11-24 11:32:33 +01:00
Jan Nieuwenhuizen 78989bfb90 Fix command tracing.
* gash/builtins.scm (term->string): New function.
(trace): Use it to make nicer traces; typo: alway display trace.
2018-11-05 20:13:26 +01:00
Jan Nieuwenhuizen 678e192b4f chmod: Move permission code to shell-utils.
* gash/shell-utils.scm (<chmodifier>): New record, move from commands/chmod.
(parse-modifier, parse-modifiers, make-numeric-chmodifier,
apply-chmodifiers): New function, move from commands/chmod.
* gash/commands/chmod.scm (chmod): Remove them.
* gash/util.scm (char->string, string->string-list): New function.
2018-11-05 20:13:26 +01:00
Jan Nieuwenhuizen a0ff0853ff set: Support -u, clumped singles.
* gash/builtins.scm (set-command): Support -u, clumped singles.
* gash/environment.scm (variable): Consider `nounset'.  TODO:
propagate error.
2018-11-05 19:59:53 +01:00
Jan Nieuwenhuizen 1f9480cda1 Guile As SHell. 2018-11-05 19:59:53 +01:00
Jan Nieuwenhuizen b433052b4a builtins: Split out into gash/commands/.
* gash/commands/cat.scm: New file, expand from bournish-commands.scm.
* gash/commands/compress.scm: Likewise.
* gash/commands/cp.scm: Likewise.
* gash/commands/find.scm: Likewise.
* gash/commands/grep.scm: Likewise.
* gash/commands/ls.scm: Likewise.
* gash/commands/reboot.scm: Likewise.
* gash/commands/tar.scm: Likewise.
* gash/commands/wc.scm: Likewise.
* gash/commands/which.scm: Likewise.
* build-aux/pre-inst-env.in: New file.
* configure: Expand it.
* gash/bournish-commands.scm: Remove.
* gash/shell-utils.scm: Rename from guix-build-utils.scm.
2018-11-03 08:02:49 +01:00
Jan Nieuwenhuizen 1fd796bad7 guix: build fixes.
* bin/builtin.in: Remove gratuitous quotes.
* configure (BUILTINS): Add bash and sh scripts.
* gash/builtins.scm (command-command): Add missing format parameter.
(type-command): Likewise.
* gash/guix-build-utils.scm: Use (ice-9 format).
* gash/guix-utils.scm: Likewise.
* gash/ustar.scm (write-ustar-port): Remove catch.
(read-ustar-port): Likewise.
2018-10-29 22:09:34 +01:00
Jan Nieuwenhuizen 0f5b538c3a geesh: initial integration.
GUILE_LOAD_PATH=$HOME/src/geesh:$GUILE_LOAD_PATH
    GUILE_LOAD_COMPILED_PATH=$HOME/src/geesh:$GUILE_LOAD_COMPILED_PATH

    bin/gash --parse -c 'echo boo | sed s,o,O, | grep .'
    bin/gash --geesh --parse -c 'echo boo | sed s,o,O, | grep .'
2018-10-21 12:45:51 +02:00
Jan Nieuwenhuizen 6468b04791 refactor WORD...bummer: word-for-test-assign-sh word-for-test-if-sh 2018-07-15 23:01:52 +02:00
Jan Nieuwenhuizen 83f20d1ff8 flatten-fu 2018-07-15 20:06:19 +02:00
Jan Nieuwenhuizen bfc39b1a18 test: implement -n, -z, !=. 2018-07-15 18:19:56 +02:00
Jan Nieuwenhuizen 8f8ba68c54 resurrect set -x 2018-07-15 18:18:34 +02:00
Jan Nieuwenhuizen e6e03c6da2 parser: handle substitution in for sequence. 2018-07-15 16:08:26 +02:00
Jan Nieuwenhuizen c32034d13d command, builtin, glob, echo cleanup and fixes 2018-07-15 13:43:52 +02:00
Jan Nieuwenhuizen d065723221 parser: refactor, use `pipeline' instead of `expression'. 2018-07-15 12:49:59 +02:00
Jan Nieuwenhuizen 9623e014f0 builtins: [: New command.
* gash/builtins (bracket-command): New function.
  (%builtin-commands): Add it.
2018-07-15 12:23:27 +02:00
Jan Nieuwenhuizen b20306e123 builtins: grep: New command.
* gash/guix-build-utils.scm (<grep-match>): New record type.
  (grep): New function.
* gash/builtins.scm (grep-command): New command.
  (%builtin-commands): Add it.
2018-07-14 23:16:27 +02:00
Jan Nieuwenhuizen 0cab9321b2 builtins: test: Enhance with file tests.
* gash/guix-build-utils.scm (directory-exists?, executable-file?,
  symbolic-link?): Import from Guix.
* gash/builtins.scm (test-command): Use them to enhance with file test.
2018-07-14 23:16:27 +02:00
Jan Nieuwenhuizen 863b3b5908 builtins: test: New command.
* gash/builtins.scm (test-command): New command.
  (%builtin-commands): Add it.
  (builtin, command, doublequotes, expression, for, glob,
  singlequotes, substitution): Move from peg.scm.
* gash/peg.scm: Remove them.
2018-07-14 23:16:13 +02:00
Jan Nieuwenhuizen de6d653c7c builtins: type: New command.
* gash/builtins.scm (type-command): New function.
  (%builtin-commands): Add it.
2018-07-14 22:48:55 +02:00
Jan Nieuwenhuizen 677deaf9b3 builtins: command: New command.
* gash/builtins.scm   (command-command): New command.
  (%builtin-commands): Add it.
  (builtin): Move from peg.
* gash/peg.scm (builtin): Remove.
2018-07-14 22:48:42 +02:00
Jan Nieuwenhuizen 2c30f3c4c6 builtins: find: First naive implementation.
* gash/builtins.scm (find-command-implementation): New function.
  (find-command): New command.
  (%builtin-commands): Add it.
* gash/guix-build-utils.scm (file-name-predicate, find-files): Import
  from Guix.
2018-07-14 22:48:42 +02:00
Jan Nieuwenhuizen 97a95ee002 builtins: cd: Support `cd -'.
* gash/builtins.scm (cd-command): Support `cd -'.
2018-07-14 15:23:52 +02:00
Jan Nieuwenhuizen 56a36baee5 factor-out environment.
* gash/environment.scm: New file.
* build-aux/build-guile.sh (SCM_FILES): Add it.
* gash/peg.scm: Include it.
  (assignment, %global-variables, set-shell-opt!, variable): Remove.
2018-07-14 15:23:52 +02:00
Jan Nieuwenhuizen 23a13b0890 builtins: resurrect pwd WIP 2018-07-14 15:23:52 +02:00
Jan Nieuwenhuizen 3ea368ab2f resurrect help WIP 2018-07-14 15:23:52 +02:00
Jan Nieuwenhuizen 40aa82fca9 builtins: ls: Support -a,--all,-1,--one-file-per-line,-h,--version.
* gash/bournish-commands.scm (ls-command-implementation): Support
  -a,--all,-1,--one-file-per-line,-h,--version.
2018-07-14 15:23:21 +02:00
Jan Nieuwenhuizen c896015068 resurrect builtins: WIP 2018-07-14 13:34:10 +02:00
Jan Nieuwenhuizen 4d3751f654 resurrect builtins: WIP 2018-07-14 12:24:51 +02:00