The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
string with blank spaces psalas UNIX for Dummies Questions & Answers 4 04-16-2008 04:50 AM
Removing blank spaces from a file? dfs Shell Programming and Scripting 4 05-22-2007 05:59 PM
blank spaces getting deleted gander_ss Shell Programming and Scripting 5 05-15-2007 05:37 AM
remove blank spaces in a string spandu Shell Programming and Scripting 2 03-02-2006 02:08 AM
howtodelete blank spaces forevercalz Shell Programming and Scripting 2 09-29-2005 05:35 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-06-2007
kamicasse kamicasse is offline
Registered User
  
 

Join Date: Dec 2007
Posts: 2
problem with the blank spaces in array

Hi all!

i need your help.
I'm getting started with this...

in need to insert in an array string values. But the thing is that this strings have blank spaces...

for example if a want to put "filed1 = " and "field2 = " .... in the array , when i want to print all the fields, it only shows me the first field...
i don't know how to resolve this ... please help me.

fieldGlobal[0]="AS_DB_PWD : "
fieldGlobal[1]="BHC_DB_PWD : "
fieldGlobal[2]="REPPWD="
fieldGlobal[4]="EDTDBPW="

i=0;
while [ ${i} -le ${#fieldGlobal[*]} ]
do

echo "${fieldGlobal[i]}"

let i=$i+1
done


thanks in advance!
  #2 (permalink)  
Old 12-06-2007
d3m00n d3m00n is offline
Registered User
  
 

Join Date: Aug 2007
Posts: 7
Could you include what you have when you execute the script?
  #3 (permalink)  
Old 12-06-2007
kamicasse kamicasse is offline
Registered User
  
 

Join Date: Dec 2007
Posts: 2
it shows:
AS_DB_PWD :

$
  #4 (permalink)  
Old 12-06-2007
vgersh99's Avatar
vgersh99 vgersh99 is online now Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,119
Code:
echo "${fieldGlobal[${i}]}" 
and
let i=i+1
  #5 (permalink)  
Old 12-06-2007
d3m00n d3m00n is offline
Registered User
  
 

Join Date: Aug 2007
Posts: 7
On my box both versions gave the same result:
AS_DB_PWD :
BHC_DB_PWD :
REPPWD=

EDTDBPW=
hummm..
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:18 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0