<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: quick one: cut'ing or seding directory path to get just the filename in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/quick-one-cut-ing-or-seding-directory-path-to-get-just-the/m-p/2597154#M855018</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;something I learned yesterday from this forum:&lt;BR /&gt;This solution will not cover filenames with blanks! Enclose $F in double quotes !&lt;BR /&gt;&lt;BR /&gt;# echo $F&lt;BR /&gt;/tmp/a b c&lt;BR /&gt;# FILENAME=$(basename "$F")&lt;BR /&gt;# echo $FILENAME&lt;BR /&gt;a b c&lt;BR /&gt;# &lt;BR /&gt;&lt;BR /&gt;Volker</description>
    <pubDate>Thu, 18 Oct 2001 09:49:53 GMT</pubDate>
    <dc:creator>Volker Borowski</dc:creator>
    <dc:date>2001-10-18T09:49:53Z</dc:date>
    <item>
      <title>quick one: cut'ing or seding directory path to get just the filename</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/quick-one-cut-ing-or-seding-directory-path-to-get-just-the/m-p/2597149#M855013</link>
      <description>Hi all,&lt;BR /&gt;&lt;BR /&gt;If I have a variable $F&lt;BR /&gt;that looks something like the following:&lt;BR /&gt;/usr/bin/dothis.ksh&lt;BR /&gt;and or&lt;BR /&gt;/usr/contrib/bin/dothat.ksh&lt;BR /&gt;&lt;BR /&gt;what's the best way to extract the filename&lt;BR /&gt;echo $F | nice -and -sweet&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;Bill</description>
      <pubDate>Thu, 18 Oct 2001 09:28:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/quick-one-cut-ing-or-seding-directory-path-to-get-just-the/m-p/2597149#M855013</guid>
      <dc:creator>Bill McNAMARA_1</dc:creator>
      <dc:date>2001-10-18T09:28:00Z</dc:date>
    </item>
    <item>
      <title>Re: quick one: cut'ing or seding directory path to get just the filename</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/quick-one-cut-ing-or-seding-directory-path-to-get-just-the/m-p/2597150#M855014</link>
      <description>How about using the basename command?  Is that what you're looking for?&lt;BR /&gt;&lt;BR /&gt;-Santosh</description>
      <pubDate>Thu, 18 Oct 2001 09:32:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/quick-one-cut-ing-or-seding-directory-path-to-get-just-the/m-p/2597150#M855014</guid>
      <dc:creator>Santosh Nair_1</dc:creator>
      <dc:date>2001-10-18T09:32:28Z</dc:date>
    </item>
    <item>
      <title>Re: quick one: cut'ing or seding directory path to get just the filename</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/quick-one-cut-ing-or-seding-directory-path-to-get-just-the/m-p/2597151#M855015</link>
      <description>I guess I should have been a bit more descriptive...i.e.&lt;BR /&gt;&lt;BR /&gt;FILENAME=$(basename $F)&lt;BR /&gt;&lt;BR /&gt;not sure if this is a requirement, but you can also strip of the suffix,i.e.:&lt;BR /&gt;&lt;BR /&gt;if $F=/usr/contrib/bin/something.ksh&lt;BR /&gt;&lt;BR /&gt;FILENAME=$(basename $F .ksh)&lt;BR /&gt;&lt;BR /&gt;$FILENAME should be set to the word something.&lt;BR /&gt;&lt;BR /&gt;-Santosh</description>
      <pubDate>Thu, 18 Oct 2001 09:34:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/quick-one-cut-ing-or-seding-directory-path-to-get-just-the/m-p/2597151#M855015</guid>
      <dc:creator>Santosh Nair_1</dc:creator>
      <dc:date>2001-10-18T09:34:36Z</dc:date>
    </item>
    <item>
      <title>Re: quick one: cut'ing or seding directory path to get just the filename</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/quick-one-cut-ing-or-seding-directory-path-to-get-just-the/m-p/2597152#M855016</link>
      <description>nice one santosh,&lt;BR /&gt;That was just what I was looking for..&lt;BR /&gt;&lt;BR /&gt;It would have saved me so much pain if I knew about that around a year ago!!&lt;BR /&gt;&lt;BR /&gt;Thanks again,&lt;BR /&gt;Bill</description>
      <pubDate>Thu, 18 Oct 2001 09:40:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/quick-one-cut-ing-or-seding-directory-path-to-get-just-the/m-p/2597152#M855016</guid>
      <dc:creator>Bill McNAMARA_1</dc:creator>
      <dc:date>2001-10-18T09:40:27Z</dc:date>
    </item>
    <item>
      <title>Re: quick one: cut'ing or seding directory path to get just the filename</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/quick-one-cut-ing-or-seding-directory-path-to-get-just-the/m-p/2597153#M855017</link>
      <description>You're welcome.&lt;BR /&gt;&lt;BR /&gt;Also just FYI, you can use the dirname command to get the directory part of the full path.  Its complimentary to the basename command.&lt;BR /&gt;&lt;BR /&gt;-Santosh</description>
      <pubDate>Thu, 18 Oct 2001 09:43:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/quick-one-cut-ing-or-seding-directory-path-to-get-just-the/m-p/2597153#M855017</guid>
      <dc:creator>Santosh Nair_1</dc:creator>
      <dc:date>2001-10-18T09:43:28Z</dc:date>
    </item>
    <item>
      <title>Re: quick one: cut'ing or seding directory path to get just the filename</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/quick-one-cut-ing-or-seding-directory-path-to-get-just-the/m-p/2597154#M855018</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;something I learned yesterday from this forum:&lt;BR /&gt;This solution will not cover filenames with blanks! Enclose $F in double quotes !&lt;BR /&gt;&lt;BR /&gt;# echo $F&lt;BR /&gt;/tmp/a b c&lt;BR /&gt;# FILENAME=$(basename "$F")&lt;BR /&gt;# echo $FILENAME&lt;BR /&gt;a b c&lt;BR /&gt;# &lt;BR /&gt;&lt;BR /&gt;Volker</description>
      <pubDate>Thu, 18 Oct 2001 09:49:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/quick-one-cut-ing-or-seding-directory-path-to-get-just-the/m-p/2597154#M855018</guid>
      <dc:creator>Volker Borowski</dc:creator>
      <dc:date>2001-10-18T09:49:53Z</dc:date>
    </item>
    <item>
      <title>Re: quick one: cut'ing or seding directory path to get just the filename</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/quick-one-cut-ing-or-seding-directory-path-to-get-just-the/m-p/2597155#M855019</link>
      <description>basename works and is easy to remember, for efficiency you may try using the quick shell construct:&lt;BR /&gt;&lt;BR /&gt;NewPath=${F##*/}&lt;BR /&gt;&lt;BR /&gt;(Essentially NewPath = $F but remove the largest section from the front of F which matches the glob '*/')&lt;BR /&gt;&lt;BR /&gt;dave&lt;BR /&gt;(shell should be efficient :-)</description>
      <pubDate>Thu, 18 Oct 2001 10:48:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/quick-one-cut-ing-or-seding-directory-path-to-get-just-the/m-p/2597155#M855019</guid>
      <dc:creator>David Lodge</dc:creator>
      <dc:date>2001-10-18T10:48:28Z</dc:date>
    </item>
    <item>
      <title>Re: quick one: cut'ing or seding directory path to get just the filename</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/quick-one-cut-ing-or-seding-directory-path-to-get-just-the/m-p/2597156#M855020</link>
      <description>I did not know about dirname and basename either.  I ended up doing this:&lt;BR /&gt;&lt;BR /&gt;LIST=`echo "$1" | sed 's#/# #g' `&lt;BR /&gt;for I in $LIST&lt;BR /&gt;  do&lt;BR /&gt;  LASTI=$I&lt;BR /&gt;done&lt;BR /&gt;echo $LASTI&lt;BR /&gt;&lt;BR /&gt;Where $1 is your fullpath'd file /a/b/c/file1&lt;BR /&gt;.....or as said above:   basename $1&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 18 Oct 2001 18:36:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/quick-one-cut-ing-or-seding-directory-path-to-get-just-the/m-p/2597156#M855020</guid>
      <dc:creator>Steve Post</dc:creator>
      <dc:date>2001-10-18T18:36:11Z</dc:date>
    </item>
  </channel>
</rss>

