You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
#!/bin/bash
|
|
|
|
arrn=$(ls "$1" | wc -l)
|
|
rand=$(($RANDOM % $arrn))
|
|
if [[ $rand -eq 0 ]]; then
|
|
((rand += 1))
|
|
fi
|
|
if [[ $rand -eq 1 ]]; then
|
|
((rand += 1))
|
|
fi
|
|
ls -l "$1" | sed "${rand}q" | tail -n1 | awk '{print $9}'
|