Linux-基础教程--Shell脚本编程.pptVIP

  • 13
  • 0
  • 约 174页
  • 2017-05-30 发布于北京
  • 举报
/faq/bash-for-loop/ * #!/bin/bash # filename: change_file_SUFFIX.sh # 将当前目录下所有以($1)为后缀的文件改为以($2)为后缀的文件 if [ $# -eq 2 ]; then for f in *.$1; do mv $f `basename $f .$1`.$2; done else echo Usage: $0 SUFFIX1 SUFFIX2 echo Exmaple: $0 txt doc fi * /faq/bash-while-loop/ * /file-management/read-a-file-line-by-line/ #!/bin/bash # Shell script utility to read a file line line. # Once line is read it can be process in processLine() function # You can call script as follows, to read myfile.txt: # ./readline myfile.txt # Following example will read line from standard input device aka keyboard: # ./r

文档评论(0)

1亿VIP精品文档

相关文档