View Full Version : Query file short name

12 December 2011, 04:59 PM
Another week another question.

I was wondering how to get the short name of a file.

When I do:
string $fn = `file -q -sn`;

I get:
C:/Users/Pozest Star/Desktop/Bob.mb
I really just want Bob.mb (I want Bob, I need Bob :p)

If I have to tokenize, I will, but I thought there was an easier way to do this. Is there?


12 December 2011, 05:04 PM
you can do it with a `match` command, but Alias already packaged it up for you with the basename and basenameEx commands:
basename $fn "";:nathaN

12 December 2011, 05:37 PM
:bowdown:I want to be like you when I grow up.

Thanks so much, that worked like a charm.

12 December 2011, 07:57 PM
I want to be like you when I grow'd need a hell of a lot of hormone therapy. :p

CGTalk Moderation
12 December 2011, 07:57 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.