Tristan said:
Greetings.
Yes, and? ./a.out accomplishes this on *nix.
You are, of course, correct. I always name my executables something
else, but I'm well aware of the fact that a.out is the default, so I'm
not sure how I managed to miss that.
Depends if you need anyone else to understand it.
At an absolute minimum, I need to be able to understand it, even if no
one else needs to do so, and trying to do all of those things on a
single line would push the limits on my own ability to understand what
I was writing.
... If it's just a one-off
script, like the dozens I need to write each day, then there's no reason
why it couldn't (and shouldn't) be written directly at the command prompt
in one line. In another post I gave an example of this; it's about 110
characters long.
Your version doesn't meet the specification that a count of
compilation errors and runtime errors be collected and reported.
However, the same is true of both of jacob's versions, too. All three
"scripts" count only the number of failed compilations and the number
of failed runs, but not the number of errors. On a unix-like system
I'd pipe the compiler output to "grep -i error | wc -l", resigning
myself to the fact that it would produce an overcount due to the
possibility of the string "error" coming up for some reason (such as a
file name) in some context other than an error message.