Git Product home page Git Product logo

urchin's Introduction

Urchin
===

A Unix shell for Ruby programmers.

If you have any ideas for what you think this should mean, please submit a
ticket!

Urchin does not aim to be POSIX compliant, but is heavily influenced by Bash
and Zsh. Urchin aims to make Ruby a first class citizen in the shell and be a
good place for experimenting with new shell ideas.


Authors
===

Mark Somerville <[email protected]>
http://mark.scottishclimbs.com/
@_Spakman
Spakman on Freenode


Current status
===

Preparing to release version 0.2.0. On Linux this will be beta quality. It is
considerably less tested on other platforms. I have been using it as my login
shell since version 0.1.0 and it has been pretty stable.

Quite a lot of common Unix shell stuff is implemented: job control,
redirections, tilde expansion, aliasing, globbing and environment variables.
Functions are the most obvious thing missing from that list. These will most
likely appear in 0.3.0.

Straightforward inline Ruby is available! This was the original inspiration for
the project (although the vision has grown somewhat now). This allows writing
Ruby processes directly on the command line, without the need to escape special
characters. This will likely be expanded and improved upon in later releases.

I will create a gem for version 0.2.0.


Current problems
===

GitHub is used for ticket tracking: https://github.com/Spakman/urchin/issues


Requirements
===

Ruby
---
Tested with MRI 1.8.7, 1.9.2 and 1.9.3-dev on Linux.

If running using 1.9.2 on a laptop, be aware of bug #3436
(http://redmine.ruby-lang.org/issues/show/3436). This should be fixed when
1.9.3 is released.


rb-readline
---
Since version 0.2.0, Urchin relies on rb-readline. Use the latest version or
check it out from GitHub[1]. I'm one of the maintainers for rb-readline and
always check that Urchin works with the latest version.

1 - https://github.com/luislavena/rb-readline


ruby-termios
---
Tested with version 0.9.6.


Some examples that work
===

Pipelines:

	ls -la | head -n2

Calling a new Ruby process (~@ is the default delimiter):

	ls --no-color |~@ puts STDIN.read.reverse ~@ | sort
	ls --no-color |~@ o s.reverse ~@ | sort

Redirecting STDOUT, STDIN, STDERR:

	uptime > output
	uptime >> output
	ruby -e 'puts STDIN.read; STDERR.puts 33' < input > out_and_err 2>&1

Backgrounding jobs:

	sleep 60 &

Multiple jobs:

	sleep 60 & man sleep

	sleep 60; echo "it's over"

Quoted and unquoted parameters:

	grep -r '"hello"' .
	grep -r "\"hello\"" .
	ls my\ annoyingly\ named\ dir
	find . -name 'hello' -exec chmod 660 {} \;

Globbing:

	ls **/*.rb
	mv image?.{png,gif} images

Tilde expansion:

	ls ~/src/
	ls ~mark

Reading and setting environment variables:

	echo $PATH
	echo abx${HOME}xyz
	export HELLO="Yo man!"

Simple arithmetic (lines starting with a digit are eval-ed as Ruby):

	17 * 123

Command expansion:

	ps `pgrep urchin`

Job control (uses fg, bg and jobs builtins).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.