#!/usr/bin/env bash
function walk()
{
for file in `ls $1`
do
local path=$1"/"$file
if [ -d $path ]
then
echo "DIR $path"
walk $path
else
echo "FILE $path"
vi +":set fileencoding=utf-8" +":set fileformat=unix" +":wq" $path
fi
done
}
if [ $# -ne 1 ]
then
echo "USAGE: $0 TOP_DIR"
else
walk $1
fi
没有评论:
发表评论