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.


👤 Login to reply

    #8  
Old 02-05-2018
RudiC RudiC is offline Forum Staff  
Moderator
 
Join Date: Jul 2012
Last Activity: 21 July 2018, 12:24 PM EDT
Location: Aachen, Germany
Posts: 13,082
Thanks: 452
Thanked 4,017 Times in 3,693 Posts
Try also
Code:
IFS=,
ARRAY=( $(sed 's/./&,/g;' /tmp/ARRAY) )

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

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 01:18 PM.

Unix & Linux Forums Content Copyrightę1993-2018. All Rights Reserved.
×
UNIX.COM Login
Username:
Password:  
Show Password





Not a Forum Member?
Forgot Password?