and i want to use the file with "while" and having the fields splitted into new variables for treatment :
while read LINE
do
# Ignorer les commentaires un # en premiere position
if [ "`echo $LINE|cut -c1`" = "#" ]
then
continue
fi
set `echo $LINE`
REP_PERE=$1
SELECT=$2
NB_JOUR=$3
done < $LISTE_FILE
but obviously the 1st field $1 needs to be interpreted ,
LOGCOM is charged running the main script.
At this time i have already REP_PERE="$LOGCOM"
I tried with expr and eval without success.
Well the code is ok except that the original value of the input file :
$LOGCOM * 5
is not translated
we should have the original value of LOGCOM in the variable REP_PERE
this script is running on differents user accounts
exemple : user01 ; user02
and LOGCOM=/user01 or /user02 and so on
and REP_PERE should equal "/user01" for example
To make things clear for me: You got a main script that sets the value of the variable LOGCOM and exports it, then the script you posted is called which reads the textfile and gets the variable name. You wish to assign the value of the read variable to REP_PERE.
Try REP_PERE=`eval echo $1` in your original script.