Show Password

Admin Notice

OS X (Apple)

OS X is a line of Unix-based graphical operating systems developed, marketed, and sold by Apple.

Create a bash array from a flat file of whitespaces only.

OS X (Apple)


Thread Tools Search this Thread Display Modes
Old 02-05-2018
RudiC RudiC is offline Forum Staff  
Join Date: Jul 2012
Last Activity: 15 July 2018, 3:56 PM EDT
Location: Aachen, Germany
Posts: 13,051
Thanks: 444
Thanked 4,006 Times in 3,683 Posts
Try also

ARRAY=( $(sed 's/./&,/g;' /tmp/ARRAY) )

You may want to save the old IFS value beforehand.
Sponsored Links

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Create a flat file and directory structure heros Shell Programming and Scripting 11 02-26-2013 04:41 AM
Read a flat file, evaluate and create output. UNIX SCRIPT. mrreds UNIX for Dummies Questions & Answers 4 04-19-2012 06:02 PM
perl: Read array from a flat file Pratik4891 Shell Programming and Scripting 8 11-23-2011 10:30 AM
Possible performance improvement (Bash and flat file) prafulnama Infrastructure Monitoring 9 05-11-2010 06:05 PM
csv file to array, match field1, replace in flat file field1 to field2 frankie_konin Shell Programming and Scripting 23 02-03-2009 02:46 PM

All times are GMT -4. The time now is 02:40 AM.

Unix & Linux Forums Content Copyrightę1993-2018. All Rights Reserved.