gosh

command module
v0.0.0-...-dbb24f3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 11, 2017 License: MIT Imports: 19 Imported by: 0

README

gosh

An attempt at a POSIX compliant shell in Golang.

Currently only supports script files and lacks some important shell features like redirections, subshells and nested variables in some cases. See the test-files folder for more examples of what currently works.

Not perfect but it is currently in code freeze for submission. I think the biggest problem right now are the circular dependencies. Move Scope from the variables package into main and figure some way for arith to continue working

Uses Govend for vendoring. This will only matter if you add a dependency and if you would like you can manually copy the code and edit vendor.yml to contain the revision ID

License

Gosh is licensed under MIT.

TODO

  • Word splitting
  • Filepath globbing
  • Redirections - Generic redirections to and from files, fd's, sockets etc.
  • Background / Async commands - Should be quite easy just run Eval in goroutine and return ExitSuccess
  • backquotes
  • Fix naive parsing - Arith grabs upto its matching brackets but does not interpret any embedded arith or variables.
  • Character escaping in strings
  • Interactive support - Use the golang readline port and add in prompts where needed
  • Shell options - I.e set -x, prints line before evaluation. set -e exits on any non-zero status
  • Switch to a log library (write one?) that follows Dave Cheneys blog post ideas. See https://github.com/danwakefield/kisslog
  • Shebang - Preparse first line of a file. (Done by exec.Command)
  • tilde expansion
  • Builtin commands - source / . will probably be first
  • Functions - Requires variables.Scope to be updated to be a more generic store I.e not just variables but func / aliases
  • Pipeline Support - Requires changes to eval signature for passing IO redirections
  • Fix arithmetic ternary bug - See comments in file
  • Subshells

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
T
Package builtins
Package builtins

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL