LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 07-17-2006, 10:00 AM   #1
delmoras
LQ Newbie
 
Registered: Nov 2005
Posts: 18

Rep: Reputation: 0
Question help with shell script - fill an array with values from a file


hello guys,i am having problems filling an array with values from a file?can anyone help me?
the file format is like this:

john/
george/
mary/
nick/

thanks.....
 
Old 07-17-2006, 12:19 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,679
Blog Entries: 54

Rep: Reputation: 2955Reputation: 2955Reputation: 2955Reputation: 2955Reputation: 2955Reputation: 2955Reputation: 2955Reputation: 2955Reputation: 2955Reputation: 2955Reputation: 2955
Please note reading answers doesn't equal learning.

Code:
array=($(< file))
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
bash shell script split array robertngo Programming 13 06-20-2011 12:01 AM
script to read file into array STAGED Programming 4 01-27-2006 09:06 PM
How to return values into an array using awk Helene Programming 1 05-01-2004 11:05 PM
How to change parameter values of a function in shell script? Bassam Programming 0 01-25-2004 10:52 AM
shell script array problem rche3252 Programming 1 10-09-2003 12:43 AM


All times are GMT -5. The time now is 11:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration