I'm a linux noob.
When I type echo $(cal)
in bash it prints calendar without any formatting.
But when i type echo "$(cal)"
it prints the complete formatted calendar.
What is the distinction between these 2 commands ?
btw, this case is described in the book The Linux Command Line by William E. Shotts, Jr. [in 7th chapter's command substitution section ]
but I couldn't get it :(
echo "$(somecommand)"
is just an overcomplicated way to runcal
. I recommend running your scripts through it, at least until you get more experience. – Gordon Davisson Aug 17 '21 at 06:34