The array contains the lines of a data file with As mentioned earlier, BASH provides three types of parameters: Strings, Integers and Arrays. find's default newline-delimited output can't be post processed as the newline character is as valid as any in a file path. If you could post part of your file, the result you have now and the expected result, a sample of your problem, then it would be easier to help you! You have two ways to create a new array in bash script. Bash read file for pattern matches and load into array - bash_grep_into_array.sh. BashRead lines of a file into an array. 1.113 I need to put every single whitespace character into a bash array cell. This is the sample json I have pasted here. For example "10.38.32.202" has to be converted to everywhere in the JSON. bash: reading a file into an array. In dieser Beispieldatei... Login to Discuss or Reply to this Discussion in Our Community, ---------- Post updated at 12:07 PM ---------- Previous update was at 11:42 AM ----------, ---------- Post updated at 12:35 PM ---------- Previous update was at 12:33 PM ----------, ---------- Post updated at 12:37 PM ---------- Previous update was at 12:35 PM ----------, Bash to append array value to file before copying. Last Activity: 28 September 2010, 1:43 AM EDT. Example (I need just 3 variables, whole lines). It is important to remember that a string holds just one element. like follows * MOVIE A bla bla MOVIE B blubb blubb MOVIE C I'd like to read the file "Movie.ini" with cat and grep and check whether it includes the string MOVIE only with a '*' … 60.8k 22 22 gold badges 159 159 silver badges 246 246 bronze badges. X=(2H 4S 10D QC JD 9H 8S) This is the sample json I have pasted here. I have a flat file 1920 bytes in size of whitespaces only. Bash: Read Typed Input w/ Tab Parsing Into Array, Then Use Array Elements 1-by-1 With Grep. =o). I want to set up an array using command line parameters. bla bla 1.113 There are two primary ways that I typically read files into bash arrays: Method 1: A while loop. Strings are without a doubt the most used parameter type. Or with a loop: arr=()while IFS= read -r line; do arr+=("$line")done