1234567891011121314151617181920212223242526272829 |
- #!/bin/bash
- # copyright (c) 2013 jeff cliff
- # this file is licensed under the GNU GPLv3 or at your option any later version
- # see COPYING.GPL
- file -E $1 >/dev/null
- if [[ $? -eq "1" ]]; then
- echo "file doesnt exist"
- exit 1;
- #else
- # echo "...exists"
- fi
- DICE=`wc -l $1 | awk -F' ' '{print $1}'`
- # echo $DICE
- NUMBER=`rolldice 1d$DICE`
- # echo $NUMBER
- NUMBER1=$NUMBER"p"
- # echo $NUMBER1
- sed -n $NUMBER1 $1
- # if this ever doesnt work the next thing to investigate is gnu 'shuf'
|