让用户输入需要脚本运行的次数然后按照用户需求执行若干次命令,这个脚本要怎么写
#!/bin/bash
read i
a=0
while [ $a -ne $i ]
do
xdotool mousemove 30 70 click 1
done
我用了这个后那滑鼠就一直在点,可能是a 没有跟着增加 就变成a 没有到所需要的数字,各位大大,麻烦帮忙看看,谢谢!
问关于循环的脚本
- 枫叶饭团
- 帖子: 14683
- 注册时间: 2010-06-16 1:05
- 系统: Mac OS X
- 来自: Tencent
- 联系:
- cjxgm
- 帖子: 1952
- 注册时间: 2010-04-23 20:40
- 系统: Arch Linux
- 来自: 浙江·杭州
- 联系:
Re: 问关于循环的脚本
[bash]
#!/bin/bash
read i
a=0
while [ $a -ne $i ]
do
xdotool mousemove 30 70 click 1
((a++))
done
[/bash]
#!/bin/bash
read i
a=0
while [ $a -ne $i ]
do
xdotool mousemove 30 70 click 1
((a++))
done
[/bash]
-
- 帖子: 1453
- 注册时间: 2008-05-24 8:30
Re: 问关于循环的脚本
[bash]
#!/bin/bash
read i
for ((a=0; a<i; a++)); do
do
xdotool mousemove 30 70 click 1
done
[/bash]
#!/bin/bash
read i
for ((a=0; a<i; a++)); do
do
xdotool mousemove 30 70 click 1
done
[/bash]
- pisit
- 帖子: 413
- 注册时间: 2008-07-08 10:39