cmd: remove trailing \n's; make singleLine head safe; ignore dep versions

mirrors the sh behaviour of VAR=$(cmd ...)
- simplifies quite a few of the invocations
latter helps haskell-platform to build recursively