Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

bash load file as 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 #load #file #array
ADD COMMENT
Topic
Name
5+4 =