4 ms·
I find it very much easier to just enter irb or run ruby with -e and hack around with backquoted strings instead of using bash to loop through and manipulate fi
by sunkencity 17y ago
I find it very much easier to just enter irb or run ruby with -e and hack around with backquoted strings instead of using bash to loop through and manipulate filenames.
a silly usecase would be reversing all the file names:
ruby -e '`ls -1`.each_line { |x| `mv #{x.chomp} #{x.chomp.reverse}` }'
pbcopy is pretty cool feature though.
- emson 17y agoYes I like the idea of using Ruby I find it a little more intuitive. Thanks. Also you may want to look at commandlinefu.com: http://www.commandlinefu.com/commands/tagged/34/bash http://www.commandlinefu.com/commands/tagged/34/bash
- Xichekolas 17y agoAlso fun as far as ruby on the command line goes: Rush http://rush.heroku.com/ http://rush.heroku.com/