Run /usr/local/bin/report once today at 17:00.
Provide the job through standard input without opening an editor.
Which command is appropriate?
at TIME registers a one-time job and reads its command list from standard input.
Detailed explanation
printf '%s\n' '/usr/local/bin/report' | atq 17:00Incorrect. atq lists queued jobs.
Incorrect. atq lists queued jobs.
printf '%s\n' '/usr/local/bin/report' | atrm 17:00Incorrect. atrm removes queued jobs.
Incorrect. atrm removes queued jobs.
printf '%s\n' '/usr/local/bin/report' | at 17:00Correct. at 17:00 accepts the command from standard input.
Correct. at 17:00 accepts the command from standard input.
printf '%s\n' '/usr/local/bin/report' | crontab 17:00Incorrect. crontab is for recurring schedules.
Incorrect. crontab is for recurring schedules.
Try it yourself
An example you can run in a temporary verification environment.
printf '%s\n' '/usr/local/bin/report' | sed -n '1p'; printf '%s\n' 'schedule: 17:00'Expected result
/usr/local/bin/report
schedule: 17:00Key points
- at is one-time
- Job text via stdin
- atq lists jobs
Notes
- Environment: POSIX shell / 登録せず入力形だけを確認
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.