I would expect this to print the contents of foobar.txt:
echo "~/sandbox/foobar.txt" | cat
But instead it just prints to the console:
~/sandbox/foobar.txt
How can I cat
the file contents instead of printing the filename?
EDIT: Here's a non-contrived example of what I'm actually trying to do:
echo $RESULT \
| grep "check file .*make.err" \
| sed -e "s/.*check file '//" \
| sed -e "s/'.*//" \
| xargs cat
EDIT 2: RESULT holds the output of a previous command in my script file. Here is what that might look like:
runspec v6152 - Copyright 1999-2008 Standard Performance Evaluation Corporation
Using 'macosx' tools
Reading MANIFEST... 18357 files
Loading runspec modules................
Locating benchmarks...found 31 benchmarks in 6 benchsets.
Reading config file '/Users/<REDACTED>/spec/installation/config/<REDACTED>.cfg'
Benchmarks selected: 400.perlbench
Compiling Binaries
Building 400.perlbench base macosx-ia32-iccifortv101-pgofast-static default: (build_base_macosx-ia32-iccifortv101-pgofast-static.0000)
Error with make 'specmake build': check file '/Users/<REDACTED>/spec/installation/benchspec/CPU2006/400.perlbench/build/build_base_macosx-ia32-iccifortv101-pgofast-static.0000/make.err'
Command returned exit code 2
Error with make!
*** Error building 400.perlbench
If you wish to ignore this error, please use '-I' or ignore errors.
The log for this run is in /Users/<REDACTED>/spec/installation/result/CPU2006.062.log
The debug log for this run is in /Users/<REDACTED>/spec/installation/result/CPU2006.062.log.debug
*
* Temporary files were NOT deleted; keeping temporaries such as
* /Users/<REDACTED>/spec/installation/result/CPU2006.062.log.debug
* (These may be large!)
*
runspec finished at Sat Feb 21 08:40:02 2015; 15 total seconds elapsed