Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

// request.cf · coarse context

A page that knows where it met you.

Only coarse request metadata is shown. This demo does not display or persist visitor IP addresses.

Country
US
Cloudflare location
CMH
Connection
HTTP/2
Language
Not provided

Ray ID: a21f4855cc149318

Jump to content

Talk:basename

Page contents not supported in other languages.
Add topic
From Wikipedia, the free encyclopedia
Latest comment: 1 year ago by Stevebroshar in topic Untitled

Untitled

[edit]

i would like to know differences between Unix and Linux in details.

OK... but not relevant to this article. Post to Quora or something.Stevebroshar (talk) 19:49, 18 May 2025 (UTC)Reply

What's the complementary function?

[edit]

basename is great and I use it all of the time. However, I need to get the directory name from a path. Is there a function that does that?!?

Thanks.

It's dirname. --TheParanoidOne 22:59, 9 March 2006 (UTC)Reply

Untitled

[edit]

Is there a word for "basename without extension"? I propose barename. —Preceding unsigned comment added by 84.188.134.52 (talkcontribs) 00:12, 31 August 2006 UTC

How about (in bash)
$ barename() { basename $1 | sed -e 's/[.].*$//'; }
$ barename dirA/dirB/somebasefile.ext
somebasefile

--WayneMokane 20:52, 31 July 2007 (UTC)Reply

typo crxn

[edit]

I added a semicolon in the example script before 'done'. Afaik, the script would not run without that (and it didn't run when I tried it as-is). Hope that's correct now. Mcswell (talk) 17:52, 27 May 2013 (UTC)Reply