LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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, 09: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, 11:19 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,134
Blog Entries: 54

Rep: Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791
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-19-2011 11:01 PM
script to read file into array STAGED Programming 4 01-27-2006 08:06 PM
How to return values into an array using awk Helene Programming 1 05-01-2004 10:05 PM
How to change parameter values of a function in shell script? Bassam Programming 0 01-25-2004 09:52 AM
shell script array problem rche3252 Programming 1 10-08-2003 11:43 PM


All times are GMT -5. The time now is 10:38 AM.

Main Menu
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