diff --git a/make.sh b/make.sh index 64828d4..97d3858 100644 --- a/make.sh +++ b/make.sh @@ -12,7 +12,7 @@ ap_state="normal" while [ $# -gt 0 ]; do echo $1 [ $ap_state = "get_outfile" ] && outfile=$1 && ap_state="normal" - [ $1 = "-o" ] && [$ap_state = "normal" ] && ap_state="get_outfile" + [ $1 = "-o" ] && [ $ap_state = "normal" ] && ap_state="get_outfile" [ $1 = "-h" ] && echo "Syntax: $0 [--help|-h|-o Outputfile] Inputfile" && exit 0 [ $1 = "--help" ] && echo "Syntax: $0 [--help|-h|-o Outputfile] Inputfile" && exit 0 [ $1 != "-o" ] && [ $ap_state = "normal" ] && infile=$1 diff --git a/select.sh b/select.sh index f9a2d8c..e0d510a 100644 --- a/select.sh +++ b/select.sh @@ -6,6 +6,6 @@ get_data () { sed '1,/^#EOF$/d' < "$SELF" | tar xz -O "$1" } -#lines=$(D $(get_data elb.tsv | wc -l | cut -d' ' -f1)) -get_data elb.tsv | awk "BEGIN{FS=\"\\t\"; r=int(rand()*$lines)+1} r==NR{print \$1 \" \" \$4 \":\" \$5 \"\\t\" \$6}" +lines=$(get_data elb.tsv | wc -l | cut -d' ' -f1) +get_data elb.tsv | awk "BEGIN{FS=\"\\t\"; srand();r=int(rand()*$lines)+1} r==NR{print \$1 \" \" \$4 \":\" \$5 \"\\t\" \$6}"