Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Essentially, I have a file containing the path to another file. A single line looks like this.


Now, separately...

> cat "/home/self/file"
blah blah

> grep '".*"' /path/to/containing/file

> cat $(grep '".*"' /path/to/containing/file)
cat: "/home/self/file": No such file or directory

The results are weird. How do I circumvent this?

share|improve this question
up vote 0 down vote accepted

It's because of the double quotes.

If possible modify the path/to/containing/file and remove the quotes. If not possible add a piped process (tr or sed or something similar) to remove the quotes from the process substitution.

share|improve this answer
Ah, yeah, that's it. Any idea why that is? cat doesn't seem to mind quotes ordinarily. – user34900 Mar 25 '13 at 12:26
In your first command, the quotes are processed by the shell before being sent to cat, quotes are simply never part of the file name. Don't forget to mark the answer as accepted if it solves your issue. – rahmu Mar 25 '13 at 12:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.