LFCS · Question #559
Each entry in a crontab must end with which of the following characters?
The correct answer is D. newline. Each individual entry or job definition within a crontab file must be terminated by a newline character to be properly parsed and scheduled by the cron daemon.
Question
Options
- Atab
- Bspace
- Cbackslash
- Dnewline
How the community answered
(26 responses)- A4% (1)
- B4% (1)
- D92% (24)
Why each option
Each individual entry or job definition within a crontab file must be terminated by a newline character to be properly parsed and scheduled by the cron daemon.
While tabs are used to separate fields *within* a cron entry, they do not mark the end of the entire entry.
Spaces are used to separate fields and arguments within a command, not to terminate the entire entry.
A backslash is typically used for line continuation in shell scripts or escaping characters, not to terminate a crontab entry.
Cron entries are line-oriented; the cron daemon reads each line as a distinct job definition. Therefore, a newline character (` `) is essential to signal the end of one job entry and ensure that subsequent entries (or the end of the file) are correctly processed. Without a newline, the last entry might not be executed or could cause parsing errors.
Concept tested: Crontab entry formatting
Source: https://man7.org/linux/man-pages/man5/crontab.5.html
Topics
Community Discussion
No community discussion yet for this question.