是否有一个包含command1、command2、command3、command4、etc的命令在运行时会在它们之间循环?
然后,我的想法是使用一个带有快捷方式或启动程序的命令(例如,在~/.local/share/applications中,或者在面板或码头启动程序中)在不同的命令之间循环。
我正在寻找类似于disper对循环显示所做的操作:disper --cycle-stages='-e : -c : -S : -s' --cycle是在可以单独运行的命令之间循环的命令:disper -e、disper -c、disper -S、disper-s。它有助于在不同的命令之间循环。
但是,虽然disper用于循环显示,但我想知道是否有一个CLI工具可以在任何单独的命令之间循环。我考虑的是不使用disper的循环显示,这并不总是起作用;例如,我可以通过这种方式拥有一个启动程序或快捷方式来执行如下的循环命令:
xrandr --output VGA1 --auto --output LVDS1 --off
xrandr --output VGA1 --auto --left-of LVDS1 --output LVDS1 --auto --primary
xrandr --output VGA1 --auto --left-of LVDS1 --primary --output LVDS1 --auto
xrandr --output VGA1 --off --output LVDS1 --auto 应该是这样的:cycling-tool 'command1, command2, command3, command4'
我是一个中等的GUI用户,在使用CLI方面一点也不先进。如果我所要求的原则理由是不可能的,请提供一个适合于一定程度的庸俗化(不要太深奥)的回答。
发布于 2017-01-23 10:56:01
如果你在巴什贝壳,
Ctrl + r Recall the last command including the specified character(s)
searches the command history as you type.您可以尝试Ctrl + r,并在所有命令(如disp )之间键入第一个公共字符。如果您一直按下ctrl并重复执行r,则shell将循环执行这些命令。
https://unix.stackexchange.com/questions/339502
复制相似问题