1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#!/usr/bin/gawk # Challenge 002 # # Challenge #1 # Write a script or one-liner to remove leading zeros from positive numbers. BEGIN { num = ARGV[1]; if (match(num, /^0*([0-9]+)/, capture)) print capture[1]; else print num; exit 0; }