If your numbers change often, you could make it an alias in .kshrc (or whatever shell you're using) as:
Code:
alias ca="awk 'BEGIN{for(i=ARGV[1]; i<ARGV[2]; i++) print \"cal \"i\" 2011\"}'"
That char escaping is needed. And then call it, for example, as:
Apart from using awk's ARGV array, there is also "-v" option on (POSIX) compliant awk's for passing of shell variables to awk:
Code:
$ cat <<eof>test.awk
> #!/usr/bin/awk -f
>
> BEGIN{
> for(i=a; i<=b; i++) print "cal "i" 2011"}
> eof
$ ./test.awk -va=8 -vb=12
cal 8 2011
cal 9 2011
cal 10 2011
cal 11 2011
cal 12 2011
Cheers