⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 list-glob.sh

📁 Shall高级编程
💻 SH
字号:
#!/bin/bash# list-glob.sh: Generating [list] in a for-loop, using "globbing"echofor file in *#           ^  Bash performs filename expansion#+             on expressions that globbing recognizes.do  ls -l "$file"  # Lists all files in $PWD (current directory).  #  Recall that the wild card character "*" matches every filename,  #+ however, in "globbing," it doesn't match dot-files.  #  If the pattern matches no file, it is expanded to itself.  #  To prevent this, set the nullglob option  #+   (shopt -s nullglob).  #  Thanks, S.C.doneecho; echofor file in [jx]*do  rm -f $file    # Removes only files beginning with "j" or "x" in $PWD.  echo "Removed file \"$file\"".doneechoexit 0

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -