in DevOps

Remove the leading spaces of the output from the command “uniq”

If you want to remove the leading spaces, just pipe the output to sed to do so:

uniq -c file | sed 's/^\s*//'

Example:

$ uniq -c file
      2 00
      2 01
      2 00
      2 02
      1 03
      3 aa
$ uniq -c file | sed 's/^\s*//'
2 00
2 01
2 00
2 02
1 03
3 aa