Cut patten between slashes

From: Wyatt (itlrn_at_techie.com)
Date: 05/22/04


Date: 22 May 2004 05:05:27 -0700

I have a file listed as

/dir1/sd11/sd111/sd1111/file1
/d2/sd2/file2
/d3/sd31/sd34/sd345/sd3456/sd34567/file3

I want to extract only filenames from this and write them into another file

file1
file2
file3

How do I do this ? Anyhelp is appreciated.



Relevant Pages

  • Re: Need Help
    ... eg: file1, file2, file3 etc ... into, max 5-6, chunk files and then loading these chunk files into ...
    (comp.unix.shell)
  • RE: [SLE] File Counts

    (SuSE)
  • Re: fopen() with full path affecting subsequent fopen calls
    ... Normally I would expect file2 to be written in the same place as it ... did when I didn't use the full path for file1. ... as well as file3 (which ... It's very likely a "current working directory" problem of some sort, ...
    (comp.lang.c)
  • Re: Problems with tar (tcllib)
    ... I have a simple script that uses the tcllibtarcommand. ...
    (comp.lang.tcl)
  • Re: Need Help
    ... eg: file1, file2, file3 etc ... This means that if script is executing file1, ...
    (comp.unix.shell)