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 2 Weeks Ago   -   Original Discussion by wisecracker
RudiC's Unix or Linux Image
RudiC RudiC is offline Forum Staff  
Moderator
 
Join Date: Jul 2012
Last Activity: 20 February 2018, 4:26 AM EST
Location: Aachen, Germany
Posts: 12,138
Thanks: 366
Thanked 3,737 Times in 3,434 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 05:41 AM
Read a flat file, evaluate and create output. UNIX SCRIPT. mrreds UNIX for Dummies Questions & Answers 4 04-19-2012 07:02 PM
perl: Read array from a flat file Pratik4891 Shell Programming and Scripting 8 11-23-2011 11:30 AM
Possible performance improvement (Bash and flat file) prafulnama Infrastructure Monitoring 9 05-11-2010 07: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 03:46 PM



All times are GMT -4. The time now is 05:51 AM.