这可能听起来像是一个愚蠢的问题,我试图解决这个问题一段时间,但我无法弄清楚如何解决它。
我有两个名为imagem.bmp
和imagem2.bmp
的图像以及一个应该使用gnome眼睛打开这两个图像的shell脚本。我在剧本中写了这个:
#!/usr/bash
eog imagem.bmp
eog imagem2.bmp
问题是只打开一个图像,即,eog打开第一个图像,然后第二个图像被加载到同一个屏幕中。我只需要在两个单独的屏幕上打开它,以便我可以比较图像。
答案 0 :(得分:6)
帮助文本总是很有用:
$ 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
。
答案 1 :(得分:2)
bash
在启动另一个命令之前等待一个命令完成执行。您可以使用&
“在后台”执行程序。试试这个:
#!/bin/bash
eog imagem.bmp &
eog imagem2.bmp &
我还修复了/usr/bash
错误。
严格来说,第二行不需要&
,但这会更快地向您返回提示,而不会等待第二个eog
进程终止。