small script help

#!/bin/ksh

for i in *.log*
do

ls $i|sed 's/\.log$//g' | while read file
do
echo "file $file is Running" >> lls.txt
echo "***************">> lls.txt

done
done

------------------------------------------------------------------

the output is :

file AdapterCCProvisioningInterface is Running
***********************************************************************************************************
file AdapterCCProvisioningInterface.log.1 is Running
***********************************************************************************************************
file AdapterCCProvisioningInterface.log.2 is Running

---------------------------------------------------------------------

but i want only 1st kind of file as o/p.......it should not display .log or .log.1 or likewise
only filename before .log like in 1st..........

i have some 170 files like that.plz help me in this

modify your sed part like below

ls $i|sed 's/\.log*/\.log/g'

now it is showing the o/p like this

file AdapterCCSendProvisioningGAP.log is Running
***********************************************************************************************************
file AdapterCCSendProvisioningGAP.log.1 is Running
***********************************************************************************************************
file AdapterCCSendProvisioningGAP.log.2 is Running
***********************************************************************************************************
file AdapterCCSendProvisioningGAP.log.3 is Running
----------------------------------------------------------------------

i just want file AdapterCCSendProvisioningGAP is Running and not .log or after .log

ls $i | sed "s/\.log*//g"

try this...

ls $i | sed "s/\.log.*$//"

this command

ls $i | sed "s/\.log.*$//"

gives the o/p as

AdapterCCSendProvisioningGAP
***********************************************************************************************************
AdapterCCSendProvisioningGAP
***********************************************************************************************************
AdapterCCSendProvisioningGAP
***********************************************************************************************************
AdapterCCSendProvisioningGAP
-----------------------------------------------------------------

but i want unique o/p.......how to make chages in this command so that it gives the same o/p but only one not repeted one

ls $i | sed "s/\.log.*$//" | sort -u

my script with sort -u

for i in *.log*
do
ls $i | sed "s/\.log.*$//" | sort -u >> lls.txt

echo "********************************">>lls.txt
done

---------------------------------------------------------------------

still the sam o/p:

reapeted ones

Do u really need a script??

will the following command wont do?

ls -1 *log*|sed -e 's/\.log.*$//'|sort -u

if i dint work then can u elaborate ur requirement pls?

yes i need to put in a script.actually i m having some 180 file like this

and i need to do some operation in that and then if any likewise files is working i need to echo that.for example

if any of these file is working

SummaryHandler.log

SummaryHandler.log.1

SummaryHandler.log .2

SummaryHandler.log .4

then simply i need to echo SummaryHandler is Running. in my script it is showing that SummaryHandler.log.1 is running ..........if any file likewise is running then i just need the name befor .log part.thats it
-------------------------------------------------------------------