Talk:Basename

From Wikipedia, the free encyclopedia

This article is within the scope of Computing WikiProject, an attempt to build a comprehensive and detailed guide to computers and computing. If you would like to participate, you can edit the article attached to this page, or visit the project page, where you can join the project and/or contribute to the discussion.
Start This article has been rated as start-Class on the quality scale
??? This article has not yet received an rating on the importance scale.

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

[edit] What's the complementary function?

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)

Is there a word for "basename without extension"? I propose barename. —Preceding unsigned comment added by 84.188.134.52 (talk • contribs) 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)