如何为自动打字脚本按RETURN键调用和延迟bash脚本
目前,我正在使用一个bash脚本自动键入一个短语,但我想知道如何将睡眠计数器设置为1800-1900秒。如果可能的话,我也想知道如何使脚本延迟按回车键。谢谢 这是剧本如何为自动打字脚本按RETURN键调用和延迟bash脚本,bash,random,delay,xdotool,Bash,Random,Delay,Xdotool,目前,我正在使用一个bash脚本自动键入一个短语,但我想知道如何将睡眠计数器设置为1800-1900秒。如果可能的话,我也想知道如何使脚本延迟按回车键。谢谢 这是剧本 #!/usr/bin/env bash function autotype_loop() { xdotool key space xdotool type "Text here" xdotool key Return sleep 1810 autotype_loop } autotype_loop 此用例有一个内置变量: 'R
#!/usr/bin/env bash
function autotype_loop() {
xdotool key space
xdotool type "Text here"
xdotool key Return
sleep 1810
autotype_loop
}
autotype_loop
此用例有一个内置变量:
'RANDOM'
Each time this parameter is referenced, a random integer between 0
and 32767 is generated.
如果要生成1800-1900之间的随机变量x,可以使用算术表达式:
x=$(( 1800 + $RANDOM * 100 / 32767 ))