Skip to content
Browse files

randomJunk: cleanup printfs, kill superfluous cat

  • Loading branch information...
1 parent 2902c8e commit 350d5b537d6900c9920086ff7cc78e5084ad6088 @falconindy committed Mar 9, 2011
Showing with 2 additions and 7 deletions.
  1. +2 −7 randomJunk
View
9 randomJunk
@@ -2,11 +2,6 @@
ALLOWEDCHARS='[:alnum:][:punct:]'
-if [[ $# -eq 0 ]]; then
- printf "Usage: %s <string length> [output quantity]" "${0##*/}" >&2
- exit 1
-fi
+length=${1:-10} quantity=${2:-1}
-quantity=${2:-1}
-
-cat /dev/urandom | tr -dc $ALLOWEDCHARS | fold -w $1 | head -n $quantity
+< /dev/urandom tr -dc $ALLOWEDCHARS | fold -w $length | head -n $quantity

0 comments on commit 350d5b5

Please sign in to comment.
Something went wrong with that request. Please try again.