you are already "expanding" the file patterns in your for loop's *.log* . Therefore you do not need to use ls inside the for loop anymore.
just echo the "i" to sed.
for i in *.log*
do
echo $i | sed 's/\.log$//g'
done
another way
ls *.log|sed 's/\.log$//g' | while read file
do
echo "file is $file"
done
file ImportAdapter.MRMSPreRead is Running
***********************************************************************************************************
file ImportAdapter.MRMSPreRead.log.1 is Running
***********************************************************************************************************
file ImportAdapter.MRMSPreRead.log.2 is Running
-------------------------------------------------------------------
why last 2 files are coming.only 1st file should be displayed na ?
how to eliminate last 2 types of file......see here all the files are having same name before .log
i just want the name of file and not .log.1 and .log.2 etc