Reputation: 5157
I have a script located at /usr/local/bin/gq which is returned by the command whereis gq
, well almost. What is actually returned is gq: /usr/local/bin/gq
. But the following gives me just the filepath (with some white space)
whereis gq | cut -d ":" -f 2
What I’d like to do is be able to pipe that into cat, so I can see the contents. However the old pipe isn’t working. Any suggestions?
Upvotes: 0
Views: 527
Reputation: 40773
If you want to cat
the contents of gq
, then how about:
cat $(which gq)
The command which gq
will result in /usr/local/bin/gq, and the cat
command will act on that.
Upvotes: 1