Retourner au contenu associé (journal : ~/bin)
Posté par vieuxshell le 11 octobre 2004 à 20:20. En réponse au journal ~/bin. Évalué à 2.
#!/bin/bash find=/usr/bin/find # Stop if error set -e dir=. # Process command line options args=$* for arg in $args ; do case $arg in -r) recursive=ok ;; *) dir=$arg ;; -h|--help) echo "Usage: 0ドル -r rep" esac done [ ! -d $dir ] && (echo "'$dir' is not a directory"; exit 1) # here we go !! if [ ! "$recursive" = "ok" ]; then options="-maxdepth 1" fi cd $dir $find . $options \( -name '*~' \ -o -name '.*~' \ -o -name '#*#' \ -o -name '.#*#' \ -o -name 'core' \ -o -name 'nohup.out' \) \ -exec rm -f {} \; -ls
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
[^] # Re: ~/sys/bin
Posté par vieuxshell . En réponse au journal ~/bin. Évalué à 2.
#!/bin/bash find=/usr/bin/find # Stop if error set -e dir=. # Process command line options args=$* for arg in $args ; do case $arg in -r) recursive=ok ;; *) dir=$arg ;; -h|--help) echo "Usage: 0ドル -r rep" esac done [ ! -d $dir ] && (echo "'$dir' is not a directory"; exit 1) # here we go !! if [ ! "$recursive" = "ok" ]; then options="-maxdepth 1" fi cd $dir $find . $options \( -name '*~' \ -o -name '.*~' \ -o -name '#*#' \ -o -name '.#*#' \ -o -name 'core' \ -o -name 'nohup.out' \) \ -exec rm -f {} \; -ls