📄 ex53.sh
字号:
#!/bin/bash# Using "seq"echofor a in `seq 80` # or for a in $( seq 80 )# Same as for a in 1 2 3 4 5 ... 80 (saves much typing!).# May also use 'jot' (if present on system).do echo -n "$a "done # 1 2 3 4 5 ... 80# Example of using the output of a command to generate # the [list] in a "for" loop.echo; echoCOUNT=80 # Yes, 'seq' may also take a replaceable parameter.for a in `seq $COUNT` # or for a in $( seq $COUNT )do echo -n "$a "done # 1 2 3 4 5 ... 80echo; echoBEGIN=75END=80for a in `seq $BEGIN $END`# Giving "seq" two arguments starts the count at the first one,#+ and continues until it reaches the second.do echo -n "$a "done # 75 76 77 78 79 80echo; echoBEGIN=45INTERVAL=5END=80for a in `seq $BEGIN $INTERVAL $END`# Giving "seq" three arguments starts the count at the first one,#+ uses the second for a step interval,#+ and continues until it reaches the third.do echo -n "$a "done # 45 50 55 60 65 70 75 80echo; echoexit 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -