Thursday, February 21, 2013

Execute one line command on IRB or Rails's console through Unix shell

Basic Unix approach - echo and pipe:
$ echo "<command>" | irb
For example,
$ echo "1 + 1" | irb
1 + 1
2
You can change irb to rails console to execute that command in the Rails environment.

No comments:

Config number of file descriptors on Linux

Check file descriptor limit for a process. Vary depending on owner of the process $ cat /proc/{process-id}/limits Check current number of...