Register
It is currently Thu Dec 18, 2014 2:28 pm

basename - using symlink'd script


All times are UTC - 6 hours


Post new topic Reply to topic  [ 5 posts ] 
Author Message
 PostPosted: Mon Jun 23, 2014 8:21 am   

Joined: Mon Jun 23, 2014 8:10 am
Posts: 3
I have a script, call it "foo", with the following variable:

WHATAMI=$(basename $0)

I have a symlink to "foo" from "bar"

If I execute "bar" what will be in $WHATAMI "foo" or "bar" (I'm hoping "bar").

Any help greatly appreciated.


Top
 Profile  
 PostPosted: Mon Jun 23, 2014 10:51 am   

Joined: Mon Mar 02, 2009 3:03 am
Posts: 579
hi,

why don't you try it yourself, adn see ?


Top
 Profile  
 PostPosted: Mon Jun 23, 2014 11:49 am   

Joined: Mon Jun 23, 2014 8:10 am
Posts: 3
Not at a 'Nix box right now - at sea.


Top
 Profile  
 PostPosted: Tue Jun 24, 2014 4:50 am   
Moderator
User avatar

Joined: Thu Oct 11, 2007 7:12 am
Posts: 229
Location: London - UK
It does indeed produce "bar"


Top
 Profile  
 PostPosted: Tue Jun 24, 2014 5:08 am   

Joined: Mon Jun 23, 2014 8:10 am
Posts: 3
Thanks, appreciate the response.


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: BBQpierogi and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP