mirror of
https://github.com/e1ven/Robohash.git
synced 2025-06-23 21:35:02 +00:00
27 lines
474 B
Bash
27 lines
474 B
Bash
![]() |
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
|