The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
sigempty what means? Puntino UNIX for Dummies Questions & Answers 1 04-28-2008 08:44 AM
What does ls /nosuchdir means ??? risshanth UNIX for Dummies Questions & Answers 9 02-06-2008 04:46 AM
what these statements means namishtiwari UNIX for Dummies Questions & Answers 1 01-17-2008 02:20 AM
what it means? rraajjiibb UNIX for Dummies Questions & Answers 4 08-31-2004 01:36 PM
what is means by tar xvr - E-Quality UNIX for Dummies Questions & Answers 2 09-24-2001 09:48 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 02-12-2002
yeheyaansari yeheyaansari is offline
Registered User
  
 

Join Date: Feb 2002
Location: India
Posts: 36
What does ##* means

Hi
In one of the thread I have found
echo ${SHELL##*/}

Can any of u pls let me know, what is the
interpretation for ##* over here?

Thanks.
  #2 (permalink)  
Old 02-12-2002
LivinFree's Avatar
LivinFree LivinFree is offline Forum Advisor  
Goober Extraordinaire
  
 

Join Date: Jul 2001
Location: Portland, OR, USA
Posts: 1,584
Hey, that's mine!

The Korn and Bourne Again shells (ksh and bash) have builtin mechanisms for filtering your data from a variable.

The following is taken directly from the book "Learning the Korn Shell" (ISBN 1-56592-054-6):
Code:
Assume that the variable path has the value /home/billr/mem/long.file.name, then:
Expression               Result
${path##/*/}                              long.file.name
${path#/*/}                     billr/mem/long.file.name
$path                     /home/billr/mem/long.file.name
${path%.*}                /home/billr/mem/long.file
${path%%.*}               /home/billr/mem/long
Keep in mind that this doesn't match regular expressions; the ".*" really matches a "." and then more, not just any character.

It's good for speed, instead of calling basename $path, or saying something like echo $path | sed 's/.*\///g'.
Try using time to figure out how much faster it is to do it that way...

Hope this helps.
  #3 (permalink)  
Old 02-14-2002
yeheyaansari yeheyaansari is offline
Registered User
  
 

Join Date: Feb 2002
Location: India
Posts: 36
Smile

Thanks
Sponsored Links
Closed Thread

Bookmarks

Tags
regex, regular expressions

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This 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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:50 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0