ghc-pkg appends colon to db path when piped/redirected
Quite simple. Compare the first line of output from
ghc-pkg list ghc-pkg list | head
In the second command's output, a colon gets appended at the end of the first line, compared to the first command. This is generally undesired behaviour, since the intent of redirection is to further process the output of the original command.