space2nl


SUBMITTED BY: Guest

DATE: Dec. 16, 2013, 8:01 a.m.

FORMAT: Bash

SIZE: 639 Bytes

HITS: 695

  1. #!/bin/bash
  2. # space2nl v0.1 GPL
  3. #-----------------------------------------------------------------------
  4. which sed >/dev/null 2>&1
  5. if [ $? -ne 0 ]
  6. then
  7. echo "sed is not installed"
  8. exit 1
  9. fi
  10. if [ -z "$1" ]
  11. then
  12. echo "No argument given."
  13. echo "Usage: `basename $0` pass-list"
  14. exit 1
  15. fi
  16. if [ -f $1 ]
  17. then
  18. fp=$1
  19. cat $fp | sed ':a;N;$!ba;s/\s/ \n/g' > "$fp-new"
  20. ms=$(du -h --max-depth=0 $fp-new)
  21. echo "Size of list is [$ms]!"
  22. fi

comments powered by Disqus