Query file short name

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 12 December 2011   #1
Query file short name

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 )

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

Thanks!

Last edited by PozestStar : 12 December 2011 at 05:54 PM.
 
Old 12 December 2011   #2
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
 
Old 12 December 2011   #3
I want to be like you when I grow up.

Thanks so much, that worked like a charm.
 
Old 12 December 2011   #4
Originally Posted by PozestStar: I want to be like you when I grow up.
you'd need a hell of a lot of hormone therapy.
 
Old 12 December 2011   #5
Thread automatically closed

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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 01:33 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.