3

I am writing a bash script that needs to display a diff between a remote file and my local copy. I am doing this through a command:

filepath=/home/user/test.txt
ssh $REMOTE_USER cat $filepath | diff -bu --label="remote" --label="local" - $filepath

This generates something like:

--- remote
+++ local

@@ -2,7 +2,7 @@
--- This is a line
+++ This is something else

I would like to have the $filepath value included in the label but I don't know if this is possible or how to do it. Something like this:

--- remote /home/user/test.txt
+++ local /home/user/test.txt
@@ -2,7 +2,7 @@
--- This is a line
+++ This is something else

Any Help?

Bill Baker
  • 63
  • 5

1 Answers1

3

This is what I get for posting while tired. I simply added $filepath to the --label option as in:

... --label="remote $filepath" --label="local $filepath"

Sheesh!

Bill Baker
  • 63
  • 5
  • Since this is a typo sort of question and unlikely to help anyone in the future, I suggest that you delete the question. – 4ae1e1 Nov 17 '15 at 01:16