changed fileformat of list.sh to unix

list.sh doesn't work in linux/mac due to its fileformat
This commit is contained in:
mutoo 2013-02-19 12:20:02 +08:00
parent a329817480
commit 4bc06c7fcb
2 changed files with 46 additions and 46 deletions

View File

@ -1,23 +1,23 @@
#!/bin/bash #!/bin/bash
append_str=' \' append_str=' \'
list_alldir() list_alldir()
{ {
for file in $1/* for file in $1/*
do do
if [ -f $file ]; then if [ -f $file ]; then
echo $file$append_str | grep .cpp echo $file$append_str | grep .cpp
fi fi
if [ -d $file ]; then if [ -d $file ]; then
list_alldir $file list_alldir $file
fi fi
done done
} }
if [ $# -gt 0 ]; then if [ $# -gt 0 ]; then
list_alldir "$1" list_alldir "$1"
else else
list_alldir "." list_alldir "."
fi fi

View File

@ -1,23 +1,23 @@
#!/bin/bash #!/bin/bash
append_str=' \' append_str=' \'
list_alldir() list_alldir()
{ {
for file in $1/* for file in $1/*
do do
if [ -f $file ]; then if [ -f $file ]; then
echo $file$append_str | grep .cpp echo $file$append_str | grep .cpp
fi fi
if [ -d $file ]; then if [ -d $file ]; then
list_alldir $file list_alldir $file
fi fi
done done
} }
if [ $# -gt 0 ]; then if [ $# -gt 0 ]; then
list_alldir "$1" list_alldir "$1"
else else
list_alldir "." list_alldir "."
fi fi