2

When I do the following unix command:

pwd | pbcopy

is there something I can add to the command so that the string copied to my clipboard does not have any trailing whitespace?

(fyi: The reason I ask is because when I pipe the output to pbcopy, it copies a newline character at the end, which for my purposes, I don't want)

well actually
  • 11,810
  • 19
  • 52
  • 70

1 Answers1

2

You can achieve that effect with:

echo -n `pwd` | pbcopy
yan
  • 20,644
  • 3
  • 38
  • 48