|
Computing / bash Scripting
bash Scripting Tips and TricksQuick Tips
Extended TipsRead a file (or command output) into a array, with each line as a single array elementThe following reads the contents of #!/bin/bash IFS=' ' RAWDATA=( $(< MAKE_KML.TMP) ) RAWDATA2=( $(grep SLAT *.buf | sort | uniq) ) The first two lines set newline as the field separator. You may want to set it back to space after reading the file into the array. IFS=' ' |
|
|
loaded 2012-02-06 01:48:03 • last modified 2010-04-05 10:43:37 |