【文件属性】:
文件名称:shell中的for循环用法详解
文件大小:115KB
文件格式:PDF
更新时间:2021-01-09 03:11:58
fo for for循环
for 命令:
for i in 的各种用法 :
for i in “file1” “file2” “file3”
for i in /boot/*
for i in /etc/*.conf
for i in $(seq -w 10) –》等宽的01-10
for i in {1…10}
for i in $( ls )
for I in $(< file)
for i in “$@” –》取所有位置参数,可简写为for i
注意:bash shell支持C式for循环
#!/bin/bash
j=$1
for ((i=1; i<=j; i++))
do
t