Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



Yes 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


Also fun as far as ruby on the command line goes: Rush http://rush.heroku.com/




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: