Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
Save as 'dirrand2'
SUBMITTED BY:
Guest
DATE:
Feb. 23, 2013, 10:54 p.m.
FORMAT:
Bash
SIZE:
408 Bytes
Raw
Download
Tweet
HITS:
1378
Go to comments
Report
#!/bin/bash
let
FILECOUNT
=
$RANDOM
%
`
ls
|
wc
-l
`
;
# echo $RANDOM%$FILECOUNT
for
i
in
$(
ls
)
;
do
if
[
$FILECOUNT
-gt
1
]
;
then
let
FILECOUNT-
=
1
;
else
file
$i
>/dev/null
echo
$i
>/dev/null
cd
$i
2
>/dev/null
if
[
$?
-eq
0
]
;
then
dirrand2
;
else
echo
`
pwd
`
"/"
$i
fi
exit
;
fi
done
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus