Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bash-4.2$ ruby -e 'a=gets;a.split("").uniq.map{|x|puts"#{x} : #{a.count x}"}' <<< 'Hello world'
- H : 1
- e : 1
- l : 3
- o : 2
- : 1
- w : 1
- r : 1
- d : 1
- : 1
- bash-4.2$ echo 'Hello world' | ruby -e 'a=gets;a.split("").uniq.map{|x|puts"#{x} : #{a.count x}"}'
- H : 1
- e : 1
- l : 3
- o : 2
- : 1
- w : 1
- r : 1
- d : 1
- : 1
- bash-4.2$ echo -n 'Hello world' | ruby -e 'a=gets;a.split("").uniq.map{|x|puts"#{x} : #{a.count x}"}'
- H : 1
- e : 1
- l : 3
- o : 2
- : 1
- w : 1
- r : 1
- d : 1
- bash-4.2$ printf 'Hello world' | ruby -e 'a=gets;a.split("").uniq.map{|x|puts"#{x} : #{a.count x}"}'
- H : 1
- e : 1
- l : 3
- o : 2
- : 1
- w : 1
- r : 1
- d : 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement