Hello Gurus,
I have a script developed...
#!/bin/bash
#---------------------------------------------------------------------
# This pScript will remove/replace the special characters fromfiles
#---------------------------------------------------------------------
trxdate="`date +%Y%m%d_%H%M%S`"
cd /mnt/G/Inbound/Pre-Prod/GEM/From_O/Scriptprocess
INBOUND=/mnt/G/Inbound/Pre-Prod/GEM/From_O/Scriptprocess
INBOUND2=/mnt/G/Inbound/Pre-Prod/GEM/From_O
CNTS=`ls $INBOUND/ECEPYO.dat | wc -l`
echo "$CNTS"
if (( CNTS == 0 ))
then
echo "file."
else
while [ ${CNTS} -ne 0 ]
do
CURRENTFILE=`ls ECEPYO.dat | head -1`
echo "$CURRENTFILE"
# remove/replace the special char
sed -e 's/'/ /g' -e 's/\\/ /g' -e 's/é/ /g' -e 's/�//g' -e 's/-/ /g' -e 's/-/-/g' -e 's/�//g' -e 's/`/ /g' $CURRENTFILE >> $CURRENTFILE.tmp
#copying file to folder
cp -p $INBOUND/$CURRENTFILE.tmp $INBOUND2/$CURRENTFILE
#removing the files
rm $CURRENTFILE
rm $CURRENTFILE.tmp
CNTS=`ls $INBOUND/ECEPYO.dat | wc -l`
echo "$CNTS"
done
fi
exit 0
Here my question is , I have used sed commmand to replace the special characters found in the file, so I want to trigger email (in the email I want to have which special character is replaced) if any of the listed special characters replaced to some email id like : xyz@gmail.com. Also all files will not have special characters , so some may have and some may not have.
Can anyone please help me here.
Thanks
Nandu