Article 6ME6J [SOLVED] Bash command substitution $(<datafile)

[SOLVED] Bash command substitution $(<datafile)

by
gerard4143
from LinuxQuestions.org on (#6ME6J)
From: Learning the Bash Shell 3rd Edition O'Reilly(Newham& Rosenblatt)

page 100, section Command Substitution:

"command substitution, which allows you to use the standard output of a command as if it were the value of a variable."

What is the standard output of the command in this example(where datafile is just some acsii text file)?

Code:ans="$(<datafile)"It looks like, to the uninitiated, the standard output of the command is the command substitution itself.
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments