code: #!/bin/sh set -x for f in `ls` do if test -f $f; then if [ "$f" != "$0" ]; then rm $f fi fi done set +x