Shell for用法
来源:互联网 发布:网站推广软件三尾狐 编辑:程序博客网 时间:2024/06/14 13:53
1、 for((i=1;i<=10;i++));do echo $(expr $i \* 4);done
2、在shell中常用的是 for i in $(seq 10)
3、for i in `ls`
4、for i in ${arr[@]}
5、for i in $* ; do
6、for File in /proc/sys/net/ipv4/conf/*/accept_redirects; do
7、for i in f1 f2 f3 ;do
8、for i in *.txt
9、for i in $(ls *.txt)
for in语句与` `和$( )合用,利用` `或$( )的将多行合为一行的缺陷,实际是合为一个字符串数组
============ -_- ==============for num in $(seq 1 100)
10、LIST="rootfs usr data data2"
for d in $LIST; do
用for in语句自动对字符串按空格遍历的特性,对多个目录遍历
11、for i in {1..10}
12、for i in stringchar {1..10}
13、awk 'BEGIN{for(i=1; i<=10; i++) print i}'
注意:AWK中的for循环写法和C语言一样的
2、在shell中常用的是 for i in $(seq 10)
3、for i in `ls`
4、for i in ${arr[@]}
5、for i in $* ; do
6、for File in /proc/sys/net/ipv4/conf/*/accept_redirects; do
7、for i in f1 f2 f3 ;do
8、for i in *.txt
9、for i in $(ls *.txt)
for in语句与` `和$( )合用,利用` `或$( )的将多行合为一行的缺陷,实际是合为一个字符串数组
============ -_- ==============for num in $(seq 1 100)
10、LIST="rootfs usr data data2"
for d in $LIST; do
用for in语句自动对字符串按空格遍历的特性,对多个目录遍历
11、for i in {1..10}
12、for i in stringchar {1..10}
13、awk 'BEGIN{for(i=1; i<=10; i++) print i}'
注意:AWK中的for循环写法和C语言一样的
- Shell for用法
- SHELL中for用法
- Shell for用法
- shell for用法
- shell中for循环用法
- shell中的for循环用法
- shell Learning [for 的用法]
- shell for循环用法总结
- shell中for循环用法
- shell:for和while用法
- shell for in 用法总结
- Shell for循环用法总结
- shell中的for循环用法
- Shell脚本中的for,while用法
- shell中的for循环用法详解
- 关于shell中的for循环用法
- Linux中shell编程的for循环用法
- Shell脚本中循环语句for,while,until用法
- php class中public,private,protected的区别,以及实例
- XPath遍历输出XML所有叶子节点
- Deep Learning 101
- Sqlserver2005附加数据库时出错提示操作系统错误5(拒绝访问)错误5120的解决办法
- mysql 本地忘密码
- Shell for用法
- android实现按两次返回键退出程序
- urlencode
- Android Looper简介
- Window上搭建汇编语言开发环境
- msyql数据的操作
- 洞悉linux下的Netfilter&iptables:什么是Netfilter?
- 工欲善其事必先利其器——第四弹业务线仿真回归流程剖析
- PHP 下 CURL 通过 POST 提交表单失败的原因及解决方法