Using a single (and somewhat simple) shell line, you can rename any directory to its lowercase version.
for i in *; do lcase=`echo $i | tr A-Z a-z`; if [ ! -d $lcase ]; then mv $i $lcase; fi; done;
Viva el chell !
Rien de grand ne se fit jamais sans enthousiasme.
Thursday 10 July 2008
By Geoffrey on Thursday 10 July 2008, 15:35 - Geekeries - 2 comments
Using a single (and somewhat simple) shell line, you can rename any directory to its lowercase version.
for i in *; do lcase=`echo $i | tr A-Z a-z`; if [ ! -d $lcase ]; then mv $i $lcase; fi; done;
Viva el chell !
Thursday 27 March 2008
By Geoffrey on Thursday 27 March 2008, 23:04 - Coding - one comment
A small bit of ruby to get a constant from an URL:
require 'uri'
def url_to_constant(url)
return URI.parse(url).host.gsub(/^www\./, '').capitalize.gsub(/[^a-z][a-z]/i) { |m| m.gsub(/[^a-z]/, '').upcase }.constantize
end
Nothing exceptionnal here, just a pretext to post something.