Commits

juster committed 8c839bf

Fix for use with non-gnu awks.

Don't use length on array.
Fix the multi-line ternary operator for non gawks.
Don't use a tab character when indenting header.

  • Participants
  • Parent commits 173ab70

Comments (0)

Files changed (1)

File passcard.awk

 		}
 	}
 
-	split("■ □ ▲ △ ○ ● ★ ☂ ☀ ☁ ☹ ☺ ♠ ♣ ♥ ♦ ♫ € ¥ £ $ ! ? ¡ ¿ ⊙ ◐ ◩ �", hdr)
+	end = split("■ □ ▲ △ ○ ● ★ ☂ ☀ ☁ ☹ ☺ ♠ ♣ ♥ ♦ ♫ € ¥ £ $ ! ? ¡ ¿ ⊙ ◐ ◩ �", hdr)
 	alphanum = "23456789abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"
 	alphanumsym = alphanum "@#$%&*<>?€+{}[]()/\\"
 	nums = "0123456789"
 
 function header()
 {
-	end = length(hdr)
 	for(i=2; i<=end; i++){
 		j = randidx(i)
 		tmp = hdr[i]
 !(0 + $0) { srand() }
 
 {
-	print "	 " header()
+	print "  " header()
 	print " +-----------------------------"
 	for(i=1; i<=9; i++){
 		line = i "|"
 		for(j=0; j<29; j++){
-			charset = (usedigits && i > 5 ? nums :
-				usesyms && j % 2 == 0 ? alphanumsym :
+			charset = (usedigits && i > 5 ? nums : \
+				usesyms && j % 2 == 0 ? alphanumsym : \
 				alphanum)
 			line = line substr(charset, randidx(length(charset)), 1)
 		}