mirror of
https://github.com/e1ven/Robohash.git
synced 2025-06-23 21:35:02 +00:00
Cleanup
This commit is contained in:
parent
6b1110a4d3
commit
74edc9fd2b
20
dircurse.sh
20
dircurse.sh
@ -1,20 +0,0 @@
|
||||
function dircurse()
|
||||
{
|
||||
count=0
|
||||
cd $1
|
||||
for i in `ls -U`
|
||||
do
|
||||
echo mv $i $count#$i
|
||||
count=`expr $count + 1`
|
||||
if [ -d $i ]
|
||||
then
|
||||
dircurse $i
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
if [ $? -lt 1 ]
|
||||
then
|
||||
echo "Usage: $0 directory"
|
||||
fi
|
||||
dircurse $1
|
26
tests/dircurse.sh
Executable file
26
tests/dircurse.sh
Executable file
@ -0,0 +1,26 @@
|
||||
function dircurse()
|
||||
{
|
||||
local count
|
||||
local i
|
||||
local newfile
|
||||
echo "Entering Dircurse for " $1
|
||||
count=0
|
||||
for i in `ls -U $1`
|
||||
do
|
||||
newfile=$1/`printf %03d $count`#$i
|
||||
mv $1/$i $newfile
|
||||
count=`expr $count + 1`
|
||||
if [ -d $newfile ]
|
||||
then
|
||||
echo "Dircursing $newfile"
|
||||
dircurse $newfile
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
if [ $# -lt 1 ]
|
||||
then
|
||||
echo "Usage: $0 directory"
|
||||
exit
|
||||
fi
|
||||
dircurse $1
|
Loading…
x
Reference in New Issue
Block a user