Wanted: How to strip off pathnames to obtain filenames.

Mark Runyan runyan at hpirs.HP.COM
Sat Sep 10 04:28:32 AEST 1988


>/ gandalf at csli.STANFORD.EDU (Juergen Wagner) /  5:50 pm  Sep  5, 1988 /
>If you are using csh, how about:
>
>	% set foo = /usr/john/foo/bar/src/misc/other/bugs/nil.bang
>	% echo ${foo:t}
>	nil.bang
>	%

And, if you are using ksh, how about:

  $ foo=/usr/john/foo/bar/src/misc/other/bugs/nil.bang
  $ echo ${foo##/*/}
  nil.bang
  $


Mark "...Just found that one today..." Runyan



More information about the Comp.unix.questions mailing list