|
From: btna on 15 Apr 2008 16:11 Hi all, I have a file that looks like: */tmp/dst/file1*234*RW*6790 */tmp/dst/file2*568*RW*908 */tmp/dst/file3*345*RW*746 */test/flm/file4*354*RW*987 */test/flm/file5*643*RW*645 I need to keep all of the lines with the exception of the one with file1 and file3 which have in common "/tmp/dst". I need to preserve the line /tmp/dst/file2 plus the others that start with */test Any ideas on how to do this with korn shell? Thanks! BTNA
From: Michael Tosch on 15 Apr 2008 16:56 btna wrote: > Hi all, > > I have a file that looks like: > > > */tmp/dst/file1*234*RW*6790 > */tmp/dst/file2*568*RW*908 > */tmp/dst/file3*345*RW*746 > */test/flm/file4*354*RW*987 > */test/flm/file5*643*RW*645 > > > I need to keep all of the lines with the exception of the one with > file1 and file3 which have in common "/tmp/dst". I need to preserve > the line /tmp/dst/file2 plus the others that start with */test > > > Any ideas on how to do this with korn shell? > > Thanks! > BTNA grep -v '/tmp/dst/file[13]' file -- Michael Tosch @ hp : com
From: Chris Mattern on 15 Apr 2008 17:39 On 2008-04-15, btna <btna(a)terra.com> wrote: > Hi all, > > I have a file that looks like: > > > */tmp/dst/file1*234*RW*6790 > */tmp/dst/file2*568*RW*908 > */tmp/dst/file3*345*RW*746 > */test/flm/file4*354*RW*987 > */test/flm/file5*643*RW*645 > > > I need to keep all of the lines with the exception of the one with > file1 and file3 which have in common "/tmp/dst". I need to preserve > the line /tmp/dst/file2 plus the others that start with */test > > > Any ideas on how to do this with korn shell? > grep -v /tmp/dst/file1 input-file | grep -v /tmp/dst/file3 -- Christopher Mattern NOTICE Thank you for noticing this new notice Your noticing it has been noted And will be reported to the authorities
|
Pages: 1 Prev: Environment Files Next: copy the content from corrosponding paths from two files |