rfe.sh
来自「Shall高级编程」· Shell 代码 · 共 30 行
SH
30 行
#!/bin/bash# rfe.sh: Renaming file extensions.## rfe old_extension new_extension## Example:# To rename all *.gif files in working directory to *.jpg,# rfe gif jpgE_BADARGS=65case $# in 0|1) # The vertical bar means "or" in this context. echo "Usage: `basename $0` old_file_suffix new_file_suffix" exit $E_BADARGS # If 0 or 1 arg, then bail out. ;;esacfor filename in *.$1# Traverse list of files ending with 1st argument.do mv $filename ${filename%$1}$2 # Strip off part of filename matching 1st argument, #+ then append 2nd argument.doneexit 0
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?