Unix/Linux Go Back    


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)


Tags
solved

Reply    
 
Thread Tools Search this Thread Display Modes
    #8  
Old Unix and Linux 02-05-2018   -   Original Discussion by wisecracker
RudiC's Unix or Linux Image
RudiC RudiC is offline Forum Staff  
Moderator
 
Join Date: Jul 2012
Last Activity: 21 June 2018, 4:55 PM EDT
Location: Aachen, Germany
Posts: 12,914
Thanks: 429
Thanked 3,966 Times in 3,647 Posts
Try also


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

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

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux 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:07 AM.