B balanga Mar 14, 2020 #1 I'm trying to start up emacs and run the ediff-files command to compare two files passed via the command line, but haven't figured it out yet. I think this must be somewhere close:- emacs -nw --eval "(ediff-files)" $1 $2 Can anyone help me get this working?
I'm trying to start up emacs and run the ediff-files command to compare two files passed via the command line, but haven't figured it out yet. I think this must be somewhere close:- emacs -nw --eval "(ediff-files)" $1 $2 Can anyone help me get this working?
NapoleonWils0n Mar 15, 2020 #2 Have you tried using Meld as an alternative Meld is a visual diff and merge tool targeted at developers. Meld helps you compare files, directories, and version controlled projects.
Have you tried using Meld as an alternative Meld is a visual diff and merge tool targeted at developers. Meld helps you compare files, directories, and version controlled projects.
J jb_fvwm2 Mar 15, 2020 #3 Code: sort file1.txt file1.txt file2.txt | uniq -u or some variant may suffice in some use cases.
OP B balanga Mar 15, 2020 Thread Starter #5 Bobi B. said: Try this: emacs -nw --eval '(ediff-files "path/to/file1" "path/to/file2")'. Click to expand... Thanks. That works great but I'd like to pass the filenames to the command as parameters. Just using $1 $2 doesn't work. Don't know if the $ needs to be escaped...
Bobi B. said: Try this: emacs -nw --eval '(ediff-files "path/to/file1" "path/to/file2")'. Click to expand... Thanks. That works great but I'd like to pass the filenames to the command as parameters. Just using $1 $2 doesn't work. Don't know if the $ needs to be escaped...
Bobi B. Mar 15, 2020 #6 There you go: Bash: #!/bin/sh if [ $# -eq 2 ] ; then cmd=\(ediff-files\ \""$1"\"\ \""$2"\"\) emacs -nw --eval "${cmd}" else echo usage: idiff file1 file2 fi PS: Not bulletproof, tho
There you go: Bash: #!/bin/sh if [ $# -eq 2 ] ; then cmd=\(ediff-files\ \""$1"\"\ \""$2"\"\) emacs -nw --eval "${cmd}" else echo usage: idiff file1 file2 fi PS: Not bulletproof, tho
OP B balanga Mar 15, 2020 Thread Starter #7 Thanks, that works, I'm just a little surprised that it is so difficult escape the $ signs...