Basic on UNIX - ...
Mark Brader
msb at lsuc.UUCP
Thu Feb 14 12:15:25 AEST 1985
stewart at houxf.UUCP (Bill Stewart HO 4K-435 x0705) writes:
> While I normally disparage BASIC along with the rest of you, there are
> a few places it's useful. I tend to use it for jobs that take too much
> arithmetic for shell, but are too small to bother writing in C
> FOR I = 1 TO 43
> PRINT "FOO";I
> NEXT I
My preference would be:
awk </dev/null 'BEGIN {
for (i=1; i<=43; ++i) print "foo" i }'
Yes, the </dev/null and BEGIN are a bit icky, but you can type the
whole thing on the command line, and you have C-ish syntax, and
printf if you want it.
Mark Brader
More information about the Comp.unix
mailing list