$ perl -e "rename $_, lc $_ for glob '*'"
function rmdupenv() { if [ $# = 0 ]; then return; fi local env="$1" local sep="$2" eval "export $env=$(perl -e 'my ($e, $s) = (shift, shift || q(:)); #\ for(split $s, $ENV{$e}) { #\ $h{$_} or $h{$_}=++$i #\ } #\ $,=$s; #\ %h=reverse %h; #\ print map { $h{$_} } #\ sort { $a <=> $b } keys %h' \ $env $sep)" } echo $PATH # => /bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/home/tyru/bin:/usr/local/bin/ rmdupenv PATH # => /bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/home/tyru/bin export TEST="foo-bar-baz-foo-baz" rmdupenv TEST - # => foo-bar-baz
Linux系なら
$ find -type f -exec perl -pe 's/\015\012$/\012/' {} \;
WindowsでなんらかのPerl環境がある場合は
$ # find2perlは多分インストールされてるはず $ find2perl -type f -exec perl -pe 's/\015\012$/\012/' {} \; | perl
$ skkdic-count /usr/share/skk/SKK-JISYO.* | perl -e 'print sort{do{$a=~/.*D(d+)/;$1}<=>do{$b=~/.*D(d+)/;$1}}<>'
$ skkdic-count /usr/share/skk/SKK-JISYO.* | perl -e 'print sort { ($A, $B) = map { /.*D(d+).*/; $1 } ($a, $b); $A <=> $B } <>'