Re: :t and getting senile.
- From: "Chris F.A. Johnson" <cfajohnson@xxxxxxxxx>
- Date: Mon, 25 Sep 2006 15:31:57 -0400
On 2006-09-25, george.e.sullivan@xxxxxxxx wrote:
Ok, I know I am getting old. I can't remember where I saw this, but
how do you strip off the end of string such as a command line string so
that you just get the last part after the slash bar?
Ex: /here/there/everywhere/hello.
There was something I saw somewhere with a :t that would just give me
the hello part.
I don't know about :t (that may be something non-standard, such as
csh or zsh), but in a POSIX shell:
var=/here/there/everywhere/hello
base=${var##*/}
--
Chris F.A. Johnson, author <http://cfaj.freeshell.org/shell>
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
===== My code in this post, if any, assumes the POSIX locale
===== and is released under the GNU General Public Licence
.
- References:
- :t and getting senile.
- From: george . e . sullivan
- :t and getting senile.
- Prev by Date: :t and getting senile.
- Next by Date: Re: :t and getting senile.
- Previous by thread: :t and getting senile.
- Next by thread: Re: :t and getting senile.
- Index(es):
Relevant Pages
|