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*

6
  • 6
    OK, everyone needs to relax and stop accusing each other of trolling. If you don't like a question, then downvote or ignore it and walk away. If you feel you're being attacked in comments, then do not engage but flag and walk away. Commented Apr 26, 2018 at 8:19
  • 3
    Also related: What's the difference between $(stuff) and `stuff`? Commented Apr 26, 2018 at 17:57
  • Displaying the output of a command using command substitution and echo is a bad example of command substitution because 1) the output would have been displayed anyway, 2) printf is safer to use for variable data. The example could as well be written date | sed 's/^/Today is /' Commented Jun 11, 2018 at 6:56
  • @Kusalananda I see your point that printing it immediately (with printf) is useless. I changed the phrasing a bit, from immediately to sometime later, is it more appealing? Commented Jun 11, 2018 at 15:46
  • The example might be thedate=$(date), followed by printf 'The date is %s\n' "$thedate". Commented Jun 11, 2018 at 15:48