闲人草堂

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2011年5月24日

摘要: 工作中遇到一个小需求,需要对一系列的文件进行重命名。原始格式是string_1.obj,现在想把文件名中的数字变成定长的,不足位数往前补零,即变成string_001.obj这种形式。自己学着写了个脚本,很菜的,贴上来请大家指点一下。#! /bin/bash# this script is used to rename files# the orignal filename is as XXXX_1.obj# and the final filename is as XXX_0001.obj the width of the num is given as a parameterrm resu 阅读全文
posted @ 2011-05-24 12:43 闲人草堂 阅读(2194) 评论(0) 推荐(0) 编辑