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 Tools Search this Thread Display Modes
  12 December 2011
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?


Last edited by PozestStar : 12 December 2011 at 05:54 PM.
  12 December 2011
you can do it with a `match` command, but Alias already packaged it up for you with the basename and basenameEx commands:
basename $fn "";
  12 December 2011
I want to be like you when I grow up.

Thanks so much, that worked like a charm.
  12 December 2011
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.
  12 December 2011
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
Society of Digital Artists

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

All times are GMT. The time now is 01:44 AM.

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