Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • 2
    Pedagogically, why would you put a question like that on a test? It's a corner case at best, probably a worst practice, and easily and habitually avoided by every "here document" writer ever. Sometimes you've gotta wonder about academics... Commented May 21, 2015 at 13:03
  • @Bruce: Pedagogically, because many students practice on and study from the many old exams that are readily available, and many students (and woefully many teachers) take a pattern recognition / memorization approach to learning (does anybody remember “flash cards”?) that leads to “educated” people knowing the answers to a large number of questions, and having some ability to adapt the answers to similar questions (e.g., if the answer to <<EOF is EOF, then the answer to <<foo must be foo) without really having the ability to answer questions or knowing the underlying theory.  … C’d Commented May 21, 2015 at 22:37
  • (Cont’d) …  So a teacher might strive to ask a question that isn’t trivially isomorphic to last year’s question (e.g., changing <<foo to <<bar is trivial) and that does challenge their understanding of the underlying rules and mechanisms.  That said, I agree with you; for a person to be able to answer that in a closed-book exam, he would have had to memorize every word of bash(1).  I personally, would have guessed that <<$fff would have a terminator of file.  … (Cont’d) Commented May 21, 2015 at 22:37
  • (Cont’d) …  This relates to a pet peeve of mine.  I don’t know what the problem is — it seems like some teachers have such a poor grasp of the theory themselves, that they compensate by teaching a million specific examples instead of teaching the theory.  I applaud test questions like “What is the library function that writes number to the standard output in a human-readable way?” and “What is the printf conversion type (i.e., the letter after the %) for printing floating point numbers?”.  I disapprove of questions like  … (Cont’d) Commented May 21, 2015 at 22:37
  • (Cont’d) …  “What is the exact, complete printf conversion specification to print a floating-point number with five character positions to the left of the decimal point (including - sign if appropriate, and leading spaces if necessary) and two digits to the right of the decimal point?” (unless it’s an open-book test).  I believe that there’s no benefit to memorizing the printf specs to that level of detail.  The first couple of times you need to print a floating-point number, you’ll check the man page.  If it’s something that you do often enough, you’ll learn it through repetition. Commented May 21, 2015 at 22:38