![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
| passing a variable inside a variable to a function | KingVikram | UNIX for Dummies Questions & Answers | 2 | 01-14-2008 08:28 PM |
| How to replace variable inside the variable | mani_um | Shell Programming and Scripting | 31 | 08-09-2007 11:56 PM |
| Replace variable with a user defined variable | ce124 | Shell Programming and Scripting | 1 | 04-15-2007 03:56 PM |
| Export command giving Variable Name vs the Value set for the Variable | ParNone | UNIX for Dummies Questions & Answers | 2 | 04-03-2006 12:43 PM |
| ksh: A part of variable A's name is inside of variable B, how to update A? | pa3be | Shell Programming and Scripting | 4 | 03-30-2005 12:29 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
how to get the value of a variable?
Hi, I have written the following code and trying to get the value of the variable mylist. Code:
#!/bin/sh
mylist=""
conffile=xmldir.conf
while read line
do
echo $line
mylist=""
ATTR=`echo $line | awk -F"," '{ print $2 }'`
echo -$ATTR-
if [ "${ATTR}" = "eof" -o "${ATTR}" = "" -o "${ATTR}" = "noeof" ]
then
drname=`echo $line | awk -F"," '{ print $1 }'`
mylist="$mylist $drname"
fi
done < $conffile
echo $mylist
But when I am not getting the value of mylist.Yes one more thing the xmldir.conf is a flat file of specific format. So how it can be resolved. Thanks |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|