Path: utzoo!attcan!uunet!husc6!cmcl2!nrl-cmf!ames!pasteur!ucbvax!hplabs!hpda!hpcupt1!hpsal2!morrell From: morrell@hpsal2.HP.COM (Michael Morrell) Newsgroups: comp.unix.questions Subject: Re: Wanted: How to strip off pathnames to obtain filenames. Message-ID: <14660002@hpsal2.HP.COM> Date: 2 Sep 88 15:03:52 GMT References: <5968@ihlpf.ATT.COM> Organization: HP System Architecture Lab, Cupertino Lines: 11 / hpsal2:comp.unix.questions / pcl@ihlpf.ATT.COM (pcl) / 4:07 pm Sep 1, 1988 / My question is, given a full or partial pathname, how to obtain the last field (which is the filename) in a straight foward manner. P. C. Liu pcl@ihlpf.ATT.COM ---------- You could use "echo $filename | sed 's/.*\///'", but using basename(1) is much easier. Michael