Reputation: 1304
I have the following command:
httpd.conf | grep AuthUserFile | cut -d" " -f4 | sed -e 's|["'\'']||g'
the output of this is:
/etc/httpd/secure/htpasswd.training
I did:
httpd.conf | grep AuthUserFile | cut -d" " -f4 | sed -e 's|["'\'']||g'| cat
However this just returned:
/etc/httpd/secure/htpasswd.training
I want to cat the contents of the file. How do I do this?
Upvotes: 10
Views: 24251
Reputation: 751
You could try surrounding your initial command with backticks as the argument to cat
, like so:
cat `httpd.conf | grep AuthUserFile | cut -d" " -f4 | sed -e 's|["'\'']||g'`
Upvotes: 0
Reputation: 10784
Piping to xargs cat
will pass stdin as an argument to cat
, printing the file.
Alternatively try: cat $( some command printing a filename )
.
Upvotes: 12