Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- for i in $(cat 111); do
- echo $i >> o
- done
- sort o >> l
- lastline=
- count=0
- for i in $(cat l); do
- if [[ $lastline == $i ]]; then
- let "count=$count+1"
- else
- if [[ $count > 0 ]]; then
- echo $lastline=$count
- fi
- lastline=$i
- count=1
- fi
- done
- if [[ $count > 0 ]]; then
- echo $lastline=$count
- fi
- rm o
- rm l
Advertisement
Add Comment
Please, Sign In to add comment