Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

bash store contents of file in array

# Basic syntax:
while IFS= read line; do
	FILE_IN_ARRAY+=("$line")
done </path/to/your/file.txt
# Where:
#	- this site explains arrays helpfully: 
#		https://linuxize.com/post/bash-arrays/
Source by unix.stackexchange.com #
 
PREVIOUS NEXT
Tagged: #bash #store #contents #file #array
ADD COMMENT
Topic
Name
9+2 =