A shell with ruby power
Ruby
Switch branches/tags
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
lib
test
.document
.gitignore
Gemfile
Gemfile.lock
LICENSE.txt
README.rdoc
Rakefile
VERSION
eggsh.gemspec

README.rdoc

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

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