eggsh

An interactive shell with Ruby power

Synopsis

If we want to delete all the files except files with *.c extensions, we have to do this in base:

ls | grep -v *.c | xargs rm -rf

The solution is not so obvious , and it requires the knowledge of the tools like grep, sed, awk, xargs … etc. If ruby expressions are available in the command line environment, things will be much easier:

rm -rf { ls['*'] - ls['*.c'] }
# ruby expression inside {}

Usage

gem install eggsh

Call ‘eggsh’ to start the shell. Settings of the shell are placed under ~/.eggshrc.

{ } brackets are used to evaluate ruby expressions. {> } brackets are used to evaluate ruby expressions, too, except for the output will not be executed.

Example

Making every files without extension excutable:

chmod +x { ls - ls['*.*'] }

Copyright © 2011 Andrew Liu. See LICENSE.txt for further details.