shell编程-100例

原文链接: http://www.cnblogs.com/jackgaolei/p/5151140.html
shell编程-100例

1.99乘法表

for(( i=1;i<10;i++ ))
do
        line=""
        for(( j=1;j<=i;j++ ))
        do
                line="${line} ${i}*${j}=$(( $i*$j ))"
        done
        echo $line
done

结果

1*1=1
2*1=2 2*2=4
3*1=3 3*2=6 3*3=9
4*1=4 4*2=8 4*3=12 4*4=16
5*1=5 5*2=10 5*3=15 5*4=20 5*5=25
6*1=6 6*2=12 6*3=18 6*4=24 6*5=30 6*6=36
7*1=7 7*2=14 7*3=21 7*4=28 7*5=35 7*6=42 7*7=49
8*1=8 8*2=16 8*3=24 8*4=32 8*5=40 8*6=48 8*7=56 8*8=64
9*1=9 9*2=18 9*3=27 9*4=36 9*5=45 9*6=54 9*7=63 9*8=72 9*9=81

 

2.输出

#!/bin/bash

echo "--------------------svn command---------------------------------------"
echo "-                                                                    -"
echo "-  svn st -v -u --username bj.gaolei --password y2yzzdgxmz [path]    -"
echo "-  svn up -u --username bj.gaolei --password y2yzzdgxmz [path]       -"
echo "-  ant build                                                         -"
echo "-                                                                    -"
echo "--------------------project path--------------------------------------"
echo "-                                                                    -"
echo "-  /www/wapservice.soufun.com/testwapservice                         -"
echo "-  /www/wapservice.soufun.com/wapservice                             -"
echo "-  /www/wapservice.soufun.com/fangwechat                             -"
echo "-                                                                    -"
echo "--------------------resin command-------------------------------------"
echo "-                                                                    -"
echo "-  sudo /etc/init.d/testwapservice.soufun.com.sh start               -"
echo "-  sudo /etc/init.d/testwapservice.soufun.com.sh stop                -"
echo "-                                                                    -"
echo "--------------------log-----------------------------------------------"
echo "-                                                                    -"
echo "-  /logs/resin/log/stderr-wapservice.log                             -"
echo "-  /logs/resin/log/stdout-wapservice.log                             -"
echo "-  /www/logs/resin/logs/jvm-testwapservice.log                       -"
echo "-                                                                    -"
echo "----------------------------------------------------------------------"

  

 

posted on 2016-01-22 14:27  jackgaolei 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/jackgaolei/p/5151140.html

你可能感兴趣的:(shell编程-100例)