chirpyform
Programmer
I have the following code in a script ksh:
step1()
{
#//*- CREATION DES FICHIERS POUR DIFFERENTES LOCALITES ------------------
#//*---------------------------------------------------------------------
#//*---------------------------------------------------------------------
export FENTREE1=${RADIC}/adr1.tri
export FSORTIE1=/data/PROJETS/DRACCO/wdir/aud/localite
export FEXTRACT=$Shell.step1.awk
cat > ${FEXTRACT} <<-""EOF
BEGIN {FS=";"
OFS=";"
cle_prec = ""
cle = ""
file_int = 0
file_name = ""
FSortie1=ENVIRON["FSORTIE1"]
}
{
cle = $13
if ( cle_prec != cle )
{
file_int = file_int + 1
}
file_name = FSortie1 file_int
print file_name
print $0 > file_name
cle_prec = cle
}
EOF
echo "CREATION DES FICHIERS POUR DIFFERENTES LOCALITES"
echo "FENTREE1 :" ${FENTREE1}
echo "FSORTIE1 :" ${FSORTIE1}
LC_NUMERIC=fr_FR.ISO8859-1 awk -f ${PARAM}/${FEXTRACT} ${FENTREE1} > ${FSORTIE1}
if [ $? -ne 0 ]
then
echo "Probleme dans le awk"
exit 1
fi
export FENTREE1=
export FSORTIE1=
}
the problem is that FSortie1 is empty. I have used almost exactly the same code in another environment and it worked. Is this a problem to do with my version of AWK.
I am working with :
Machine hardware: sun4u
OS version: 5.9
Processor type: sparc
Hardware: SUNW,Sun-Fire-V440
The following components are installed on your system:
Forte C 6 update 2
Sun WorkShop 6 update 2 Compilers C
Sun WorkShop 6 update 2 Development Environment
Sun WorkShop 6 update 2 DBX Debugging Tools
Sun WorkShop 6 update 2 Building Software
Sun WorkShop 6 update 2 Performance Analyzer
XEmacs 20.4 Source Distribution
Sun WorkShop 6 update 2 Documentation Set
Sun WorkShop 6 update 2 FileMerge
any help would be appreciated
Chris
step1()
{
#//*- CREATION DES FICHIERS POUR DIFFERENTES LOCALITES ------------------
#//*---------------------------------------------------------------------
#//*---------------------------------------------------------------------
export FENTREE1=${RADIC}/adr1.tri
export FSORTIE1=/data/PROJETS/DRACCO/wdir/aud/localite
export FEXTRACT=$Shell.step1.awk
cat > ${FEXTRACT} <<-""EOF
BEGIN {FS=";"
OFS=";"
cle_prec = ""
cle = ""
file_int = 0
file_name = ""
FSortie1=ENVIRON["FSORTIE1"]
}
{
cle = $13
if ( cle_prec != cle )
{
file_int = file_int + 1
}
file_name = FSortie1 file_int
print file_name
print $0 > file_name
cle_prec = cle
}
EOF
echo "CREATION DES FICHIERS POUR DIFFERENTES LOCALITES"
echo "FENTREE1 :" ${FENTREE1}
echo "FSORTIE1 :" ${FSORTIE1}
LC_NUMERIC=fr_FR.ISO8859-1 awk -f ${PARAM}/${FEXTRACT} ${FENTREE1} > ${FSORTIE1}
if [ $? -ne 0 ]
then
echo "Probleme dans le awk"
exit 1
fi
export FENTREE1=
export FSORTIE1=
}
the problem is that FSortie1 is empty. I have used almost exactly the same code in another environment and it worked. Is this a problem to do with my version of AWK.
I am working with :
Machine hardware: sun4u
OS version: 5.9
Processor type: sparc
Hardware: SUNW,Sun-Fire-V440
The following components are installed on your system:
Forte C 6 update 2
Sun WorkShop 6 update 2 Compilers C
Sun WorkShop 6 update 2 Development Environment
Sun WorkShop 6 update 2 DBX Debugging Tools
Sun WorkShop 6 update 2 Building Software
Sun WorkShop 6 update 2 Performance Analyzer
XEmacs 20.4 Source Distribution
Sun WorkShop 6 update 2 Documentation Set
Sun WorkShop 6 update 2 FileMerge
any help would be appreciated
Chris