Advanced

this also works

Story: Four ways to extract the current directory nameTotal Replies: 0
Author Content
moopst

Nov 06, 2007
5:49 PM EST
Rather than using the rev thing you can use $NF, the awk number of fields built in. Although I'll confess to using rev as a way to sort my .com's and yahoo.com's and my.yahoo.com's in a reasonable way.

holderm@harpo:~/frodoconf/toshiba$ pwd | awk -F / '{print $NF}' toshiba

Post a reply to this thread:

A free account is needed to post. Write your comment here first: your text is kept in this browser while you sign up or log in, and is waiting for you when you come back.

Your message:
|||||
10
Markdown: **bold**, *italic*, [text](https://link), - lists, > quotes, $x^2$ for math. Formatting help

Sign up and post (it is free)  or  Log in and post