The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
problem in reading a record from the file mac4rfree Shell Programming and Scripting 8 07-17-2009 08:53 AM
problem in reading a file er_zeeshan05 Shell Programming and Scripting 4 11-06-2008 09:47 PM
problem in reading file using fread arunkumar_mca High Level Programming 4 10-30-2006 08:02 PM
help me ...problem in reading a file brkavi_in Shell Programming and Scripting 6 06-19-2006 01:41 PM
Reading a CSV file into shell variables problem multidogzoomom Shell Programming and Scripting 6 10-11-2005 05:43 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 08-20-2009
sailaja_80 sailaja_80 is offline
Registered User
  
 

Join Date: Aug 2009
Posts: 17
Problem with reading from a properties file

Hi,

i have a properties file a.prop where entry is like
PROCESS_IDX=0

Now in my shell schript i am doing like this.
#!/bin/sh
. a.prop
..............
-.......................
while read line
do
# tokenize the string by ",".
var=(`echo $line | tr ',' ' '`)
echo $PROCESS_IDX --> is printing 16
but when i am giving like below
if [ "${var[$PROCESS_IDX]}" == "y" ]; then
it is giving me the below error
")syntax error: operand expected (error token is "

Thanks for your help.

---------- Post updated at 06:38 PM ---------- Previous update was at 06:33 PM ----------

and the same code works if i am putting PROCESS_IDX=0 in my shell script.

Pls help
 

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 06:28 AM.


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