0

Do commands like ls and ps actually end with a special character to indicate termination of response?

  • It is unclear what you mean. Can you be more specific? – Pilot6 Sep 15 '19 at 16:14
  • Legacy apps like ls and ps use a special character at the end which is used to determine the termination of response. – Arushi Arora Sep 15 '19 at 16:16
  • So why are you asking if you know the answer? – Pilot6 Sep 15 '19 at 16:17
  • 2
    There is no "special character", just <LF> – Pilot6 Sep 15 '19 at 16:23
  • 1
    Every command returns an exit status (tldp.org/LDP/abs/html/exit-status.html), is it that what you mean? – mook765 Sep 15 '19 at 18:02
2

No, there is no "special" character in command output.

It is plain text ending with 0x0a char that is Line Feed.

All previous lines of the output end with the same char.

  • I was talking about implicit characters. Like we don’t see them in the output. – Arushi Arora Sep 15 '19 at 16:57
  • 1
    There are none except the one I mentioned. All lines end with the same char. – Pilot6 Sep 15 '19 at 17:00
  • And the whole output as well? – Arushi Arora Sep 15 '19 at 17:12
  • 1
    What do you mean? EACH line ends with the same char including the last. What is unclear? – Pilot6 Sep 15 '19 at 17:15
  • 1
    Oh, FFS! Do ps |& od -bc. But it's up to the particular program what it outputs. – waltinator Sep 15 '19 at 22:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.