Bash: Read a file into a variable


value=$(<config.txt)

value is the variable to which you want to read the file into.

Replace config.txt with the file you want to be read.

This post is also available in: Greek

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.