[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.
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.