Basically I want to check the difference of the same file before and after a sedTried to run:diff /opt/postTrades.sh <<< $(sed 's/1\ MIN/10\ MIN/g' /opt/postTrades.sh)anddiff <<< $(sed 's/1\ MIN/10\ MIN/g' /opt/postTrades.sh) < /opt/postTrades.sh anddiff <<< (sed 's/1\ MIN/10\ MIN/g' /opt/postTrades.sh) < /opt/postTrades.shAlways getting:diff: missing operand after '/opt/postTrades.sh'diff: Try 'diff --help' for more information.What's the correct way to do it?Thanks.
Diff between a string and a file
diff;here document;here string
diff needs two file operands.  With a here-string, you pass input to diff on its standard input.To make diff read from standard input, use - as the filename:$ diff file - <<<$( sed 'expression' file )or, more portably,$ sed 'expression' file | diff file -If you are using a shell that supports process substitutions with <(...), like bash and ksh93, this may be another solution:$ diff file <( sed 'expression' file )The process substitution will show up as a file to diff and is virtually the same as:$ sed 'expression' file >tempfile$ diff file tempfile$ rm tempfile