C++ Gnome之眼-使用shell脚本在不同窗口打开两个图像
这听起来像是一个愚蠢的问题,我正在努力解决这个问题,但我不知道如何解决它 我有两个名为C++ Gnome之眼-使用shell脚本在不同窗口打开两个图像,c++,shell,C++,Shell,这听起来像是一个愚蠢的问题,我正在努力解决这个问题,但我不知道如何解决它 我有两个名为imagem.bmp和imagem2.bmp的图像,还有一个shell脚本,应该使用gnome之眼打开这两个图像。我已经在脚本中写下了这一点: #!/usr/bash eog imagem.bmp eog imagem2.bmp 问题是,只打开一个图像,即eog打开第一个图像,然后在同一屏幕中加载第二个图像。我只需要在两个单独的屏幕中打开它,以便比较图像。bash在启动另一个命令之前等待一个命令完成执行。您可
imagem.bmp
和imagem2.bmp
的图像,还有一个shell脚本,应该使用gnome之眼打开这两个图像。我已经在脚本中写下了这一点:
#!/usr/bash
eog imagem.bmp
eog imagem2.bmp
问题是,只打开一个图像,即eog打开第一个图像,然后在同一屏幕中加载第二个图像。我只需要在两个单独的屏幕中打开它,以便比较图像。
bash
在启动另一个命令之前等待一个命令完成执行。您可以使用&
在“后台”执行程序。试试这个:
#!/bin/bash
eog imagem.bmp &
eog imagem2.bmp &
我还修复了/usr/bash
错误
严格地说,第二行不需要
&
,但这将更快地向您返回提示,而无需等待第二个eog
过程终止。帮助文本总是有用的:
$ eog --help
Usage:
eog [OPTION...] [FILE…]
Help Options:
-h, --help Show help options
--help-all Show all help options
--help-gtk Show GTK+ Options
Application Options:
-f, --fullscreen Open in fullscreen mode
-c, --disable-image-collection Disable image collection
-s, --slide-show Open in slideshow mode
-n, --new-instance Start a new instance instead of reusing an existing one
--version Show the application's version
--display=DISPLAY X display to use
请注意此选项:
-n, --new-instance Start a new instance instead of reusing an existing one
不要运行
eog
,而是运行eog-n
打开一个新实例。Blender!非常感谢您的帮助!!=]