码迷,mamicode.com
首页 > 系统相关 > 详细

shell常用操作积累

时间:2017-01-21 23:30:08      阅读:266      评论:0      收藏:0      [点我收藏+]

标签:class   write   积累   字符   cal   string   while   blog   echo   

1. 拼接字符串*

#!/bin/sh

write_log(){
    local up_name=$1
    local num=${#string}

    while [ $num -le 256 ]; do
        up_name="$up_name*"
        num=$(($num + 1))
    done
    echo $up_name
}

write_log "wang"

输出:

wang*****************************************************************************************************************************************************************************************************************************************************************

 

shell常用操作积累

标签:class   write   积累   字符   cal   string   while   blog   echo   

原文地址:http://www.cnblogs.com/embedded-linux/p/6338034.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!