![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Small Search script | appu1987 | Shell Programming and Scripting | 2 | 06-03-2008 10:14 PM |
| Very small Shell Script Help... | marconi | Shell Programming and Scripting | 2 | 12-11-2007 05:44 AM |
| small script | everurs789 | Shell Programming and Scripting | 3 | 11-06-2007 05:08 PM |
| small script help | rkl1 | Shell Programming and Scripting | 1 | 12-06-2005 11:26 PM |
| Need help in a small script | super_duper_guy | Shell Programming and Scripting | 2 | 10-24-2005 10:06 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
modify your sed part like below
ls $i|sed 's/\.log*/\.log/g' Quote:
|
|
|||||
|
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 |
|
|||||
|
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 |
|
|||||
|
Quote:
Code:
ls $i | sed "s/\.log.*$//" | sort -u |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|