From: Josef 'Jupp' SCHUGT Date: 2005-08-10T21:12:21+09:00 Subject: Re: One line handies Hi! At Tue, 9 Aug 2005 12:18:13 +0900, nobuyoshi nakada wrote: > At Tue, 9 Aug 2005 09:01:45 +0900, > David A. Black wrote in [ruby-talk:151306]: > > ruby -e 'puts ENV["PATH"].downcase.split(/[:;]/).sort' > > No. /home/foo/BIN and /home/foo/bin are different directories on > case-sensitive filesystems. > > ruby -e "puts ENV['PATH'].split(File::PATH_SEPARATOR).sort" Follows version that makes PATH case-insensitive. Works even if you have several environment variables that match /^path$/ (possible under Linux et. al.) their content is printed one after another). ruby -e 'ENV.keys.grep(/^path$/i).each { |x| puts ENV[x].split(File::PATH_SEPARATOR)}' Josef 'Jupp' SCHUGT -- Terrorism is the systematic use of violence and brutality as a means of gaining some political end. So the "War on Terrorism" is a failure if it increases violence and brutality and even may be terrorism by itself if some well-known incidents turn out not to be singular ones. :-|