ex52.sh
来自「Shall高级编程」· Shell 代码 · 共 32 行
SH
32 行
#!/bin/bash# Uudecodes all uuencoded files in current working directory.lines=35 # Allow 35 lines for the header (very generous).for File in * # Test all the files in $PWD.do search1=`head -n $lines $File | grep begin | wc -w` search2=`tail -n $lines $File | grep end | wc -w` # Uuencoded files have a "begin" near the beginning, #+ and an "end" near the end. if [ "$search1" -gt 0 ] then if [ "$search2" -gt 0 ] then echo "uudecoding - $File -" uudecode $File fi fidone # Note that running this script upon itself fools it#+ into thinking it is a uuencoded file,#+ because it contains both "begin" and "end".# Exercise:# --------# Modify this script to check each file for a newsgroup header,#+ and skip to next if not found.exit 0
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?