从命令行启动 Beyond Compare
我已安装 Beyond Compare 3;
"C:\Program Files\Beyond Compare 3\BCompare.exe"
和西格温;
"C:\Cygwin\bin\bash.exe"
我想要的是能够使用诸如以下的命令;
diff <file1> <file2>
进入 Cygwin shell 并让 shell 分叉一个进程,以无法比较的方式打开这两个文件。
我查看了 Beyond Compare 支持页面,但恐怕它对我来说太短暂了。我尝试逐字复制文本(除了可执行文件的路径),但无济于事;
Instead of using a batch file, create a file named "bc.sh" with the following line:
"$(cygpath 'C:\Progra~1\Beyond~1\bcomp.exe')" `cygpath -w "$6"` `cygpath -w "$7"` /title1="$3" /title2="$5" /readonly
我应该更换 cygpath 吗?当我在命令行上输入脚本名称时,出现“找不到命令”错误。
gavina@whwgavina1 /cygdrive
$ "C:\Documents and Settings\gavina\Desktop\bc.sh"
bash: C:\Documents and Settings\gavina\Desktop\bc.sh: command not found
有人像我描述的那样使用 Beyond Compare 工作吗?这在 Windows 环境中可能吗?
提前致谢!
I have Beyond Compare 3 installed at;
"C:\Program Files\Beyond Compare 3\BCompare.exe"
and Cygwin;
"C:\Cygwin\bin\bash.exe"
What I would like is to be able to use a command such as;
diff <file1> <file2>
into the Cygwin shell and to have the shell fork a process opening the two files in beyond compare.
I looked at the Beyond Compare Support Page but I'm afraid It was too brief for me. I tried copying the text verbatim (apart from path to executable) to no avail;
Instead of using a batch file, create a file named "bc.sh" with the following line:
"$(cygpath 'C:\Progra~1\Beyond~1\bcomp.exe')" `cygpath -w "$6"` `cygpath -w "$7"` /title1="$3" /title2="$5" /readonly
Was I supposed to replace cygpath? I get a 'Command not found' error when I enter the name of the script on the command line.
gavina@whwgavina1 /cygdrive
$ "C:\Documents and Settings\gavina\Desktop\bc.sh"
bash: C:\Documents and Settings\gavina\Desktop\bc.sh: command not found
Does anyone have Beyond Compare working as I have described? Is this even possible in a Windows environment?
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Cygwin 内部的文件系统更像 unix。 cygpath 组件之所以存在,是因为驱动器的根目录出现在路径中的不同位置。 “C:\”对 Cygwin 来说没有任何意义,它认为“/”是根目录,您的驱动器必须从那里开始,因此 cygpath 扩展。另外,尝试使用 8.3 表单,如引用页面中所示:
Inside of Cygwin the filesystem is more like unix. The cygpath component is there because the root of the drive appears in a different place in the path. "C:\" doesn't mean anything to Cygwin, it considers '/' to be the root and your drives have to start from there, hence the cygpath expansion. Also, try using the 8.3 form like from the referenced page:
将此函数添加到您的
~/.bashrc
文件中。然后,您可以在命令行上编写
bc file1.txt file2.txt
并使用 Beyond Compare 获得良好的文本比较。Add this function to your
~/.bashrc
file.Then you can just write
bc file1.txt file2.txt
on the command line and get a nice text comparison using Beyond Compare.@Romain Hippeau 谢谢,我有点白痴。
要在 Cygwin 中运行 shell 脚本,您必须使其可执行。
然后运行脚本使用;
脚本位于当前目录中的位置。
@Romain Hippeau Thanks, I was being a bit of a moron.
To run a shell script in Cygwin you have to make it executable.
Then to run the script use;
Where the script is in the current directory.