zoukankan      html  css  js  c++  java
  • linux for 的用法总结

     one line

    for file in $(ls *.gz); do  gunzip -c $file > ${file%%.*}  ;done

    shell

    #!/bin/bash  
      
    for((i=1;i<=100;i++));  
    do   
    echo $(expr $i * 3 + 1);  
    done
    #!/bin/bash  
      
    for i in $(seq 1 100)  
    do   
    echo $(expr $i * 3 + 1);  
    done
    #!/bin/bash  
      
    for i in {1..100}  
    do  
    echo $(expr $i * 3 + 1);  
    done
    #!/bin/bash  
      
    list="where are you from"  
    for i in $list;  
    do  
    echo "$i is ok";  
    done
    #!/bin/bash  
      
    for i in f1 f2 f3 ;  
    do  
    echo $i is ok ;  
    done
    #!/bin/bash  
      
    for file in /var/*;  
    do  
    echo $file is file path ! ;  
    done
  • 相关阅读:
    SVN
    jenkins可视化
    Tomcat
    防火墙
    keepalived
    MHA高可用
    http
    inotifywait
    DNS
    nginx
  • 原文地址:https://www.cnblogs.com/tingxin/p/12932579.html
Copyright © 2011-2022 走看看