A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Linux / UNIX
Need help with looping in Bash Shell Script
Kishen Singh Punjabi
Joined: Sep 14, 2012
Dec 27, 2013 23:06:33
I am storing the results from DB in an array.
For example ,
Records from DB are as follows:
This is Record One
This is Record Two
when I store the above records in a array and print , it is displayed something as follows:
This is Record One This is Record Two
and when I use for loop for this I get 8 elements with each record split into 4. I understand that this is because for loop takes
as the separator of elements in the array.
I want to store each record from the database as an element in array.
Please help on how do I achieve it. Thanks for the help!!
Joined: Oct 24, 2010
Dec 28, 2013 06:21:50
, quoting allows embedding white space in array elements. There may be other helpful hints on that page if this one is not sufficient.
Always learning Java, currently using Eclipse on Fedora.
Linux user#: 501795
I agree. Here's the link:
subject: Need help with looping in Bash Shell Script
arrayList display all in one row
Reading Record by Rec Number
weird CREATE method !!!
simple sorting algorithm
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014