Skip to content

bfontaine/gosh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gosh!

Build Status Coverage Status

Gosh is a simple shell written in Go.

Install

go install github.com/bfontaine/gosh

Dependencies

  • Go 1.2 or higher
  • Readline

Usage

gosh

You’ll get a prompt, from which you can execute commands like in every other shell. Use ^D or exit to exit it.

Features

Just a basic REPL, right now.

Gosh doesn’t support quotes, escaping and wildcards, nor any loop or conditional constructions.

Builtin commands

  • alias L=V: add an alias L to V. V can be any command, even with spaces or weird characters. Aliases can’t be recursive.
  • cd <path>: change the current directory (can contain spaces)
  • echo ...: print stuff. You can insert environment variables with $var or ${var}
  • quit, exit, ^D: exit the shell

~/.goshrc

If a ~/.goshrc file exists, Gosh reads it and executes it line-by-line as if it were given on the prompt.

You can use it for common aliases, e.g.:

alias ll=ls -l
alias la=ls -la

Options

Gosh currently supports the following options:

  • -debug: show all errors
  • -trace: show all lines are they are executed, both from the ~/.goshrc and the interactive session

Use gosh -h for more info.

Editor support

About

Simple shell written in Go

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published