shell
2016-08-17 20:01
393 查看
#!/bin/bash -x #########!/bin/bash -x ###http://10798301.blog.51cto.com/ ####http://blog.csdn.net/zw_1510 #########https://github.com/lenomirei/project <<"com" ############ .(){ .|. & } ; .################ .|. 函数名 . | 管道 递归调用函数并创建管道 & 置为后台进程 ;起换作用 . 调用这个定义的函数 com for((n=0;n<=10;n++)) do set -x echo "$n" set +x echo " " done read ee echo "############ my read and addsum start ####################" for((n=0;n<=100;n++)) do echo "$n" >>0.txt done #cat 0.txt echo "################################" sum=0 max=0 min=0 while read LINE do #echo $LINE #echo "$sum+$LINE"| bc if [ $max -lt $LINE ];then max=$LINE fi [ $min -gt $LINE ]&&{ min=$LINE } let sum+=$LINE done < 0.txt echo "sum===="$sum echo "max===="$max echo "min===="$min rm 0.txt # for i in `cat 0.txt` # do # echo $i # done #read ee #for((n=0;n<=100;n++)) #do # tmp=`cat 0.txt` # echo "$tmp $n " >>0.txt #done #cat 0.txt #echo $line echo "############ my read and addsum end ####################" exit read ee echo "scale=4;1/3" | bc echo "obase=2;scale=4;1/3" | bc echo "sqrt(100)" | bc read ee read x case $x in 1[1-9] ) echo "1:$x" ;; 2? ) echo "2:$x" ;; * ) echo "default:$x" ;; esac read ee i=0 until [ $i -gt 10 ] do let i++ echo $i done read ee i=0 while [ $i -lt 10 ] do let i++ echo $i done #for i in {a..z} for ((i=0;i<10;i++)) do echo "$i" done echo "############ myfun start ####################" function myfun() { shift 1 echo "\$0->"$0 echo "\$1->"$1 echo "\$2->"$2 echo "\$#->"$# echo "\$$->"$$ return 257 } myfun argv1 argv2 argv3 echo $? ##1 256+1 echo "############ myfun end ####################" echo "######### proc start #######################" i=0 str="" arr=("|" "/" "--" "\\") while [ $i -le 70 ] do let index=i%4 printf "[%-100s][%d%%][%c]\r" "$str" "$i" "${arr[$index]}" sleep 0.1 let i++ str+='#' done echo "######### proc end #######################"
相关文章推荐
- shell 脚本笔记
- Spark入门实战系列--3.Spark编程模型(上)--编程模型及SparkShell实战
- Linux shell中的竖线(|)——管道符号
- 转: 多版本并发控制(MVCC)在分布式系统中的应用 (from coolshell)
- Linux Bash Shell入门教程
- Linux Shell case语句
- powershell学习:初识
- shell命令的执行步骤(不完整)
- 编写shell脚本遇到的问题
- shell实例浅谈之六文件特定行打印的多种方法
- Makefile使用指南
- shell 脚本 之循环 for while until 和 软件包的管理 【上】
- shell连不上linux服务器的解决办法
- shell脚本(一)
- linux shell if参数---markx
- 《Linux命令行与Shell脚本编程大全第2版》读书笔记
- 《Linux命令行与Shell脚本编程大全第2版》读书笔记
- shell:读取文件的每一行内容并输出
- shell截取字符串的方法
- 排序——shell排序