Comparing directories
I'd like to be able to select 2 samba-mounted directories in nautilus and compare their contents in meld.
The nautilus-scripts directory seems like a good way to add this feature to nautilus. Unfortunately, meld does not like to operate on network shares like "smb://server/path/to/directory". But it can operate on "~/.gvfs/path\ on\ server/to/directory" just fine, which gives me hope. So far, I've got this: ---- #!/bin/sh files="`echo $NAUTILUS_SCRIPT_SELECTED_URIS`" # Yeah, alternative sed delimiters : or | really don't make this easier gfiles=`echo $files | sed -e 's/smb\:\/\/\([^\/]*\)\/\([^\/]*\)\//\~\/\.gvfs\/\2\\ on\\ \1\//gi'` #xterm -e "echo $gfiles;sleep 10" meld $gfiles ---- But I am running into the dreaded "double-parsing" problem and I can't get the meld arguments to include the required backslashes in the "\ on\ " section. Without those backslashes, meld sees 6 arguments instead of 2. I know about the whole single-quote vs. double-quote rule, but I suspect that even though I am single-quoting the sed arguments, the whole `echo` is being re-parsed by bash, killing my backslashes. Can anyone find an alternative way of writing a nautilus-script that turns $NAUTILUS_SCRIPT_SELECTED_URIS into a valid, fully-escaped string to pass to meld? Maybe perl or awk or some other way of calling sed would work? Thanks, -Brian Z. |
or you could use KDiff
|
Quote:
The problem really boils down to this: Writing a script in bash/perl/python/whatever that takes a bash variable in the form: files = "smb://server/share/path1 smb://server/share/path2" ...and performs a simple find & replace to make it into: files = "~/.gvfs/share\ on\ server/path1 ~/.gvfs/share\ on\ server/path2" ...in order for it to be passed to meld correctly. This seems like it should be easy, but the solution escapes me (pun intended). I am sure someone could come up with an awesome one-liner to solve this! Thanks, -Brian Z. |
1 Attachment(s)
My co-worker drafted this python script to compare either local or remotely mounted files using meld from Nautilus...
|
All times are GMT -5. The time now is 06:38 PM. |