Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google site




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 01-18-2008
skyineyes skyineyes is offline
Registered User
 

Join Date: Jun 2007
Posts: 150
modify your sed part like below

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

Quote:
Originally Posted by ali560045 View Post
#!/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