The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Give the command names namishtiwari UNIX for Dummies Questions & Answers 2 01-18-2008 03:32 AM
Please give your inputs !!!! kpatel786 Shell Programming and Scripting 9 04-27-2007 07:59 AM
Can we give multiple patterns to a sed command??? kumarsaravana_s Shell Programming and Scripting 6 03-22-2007 11:19 PM
how to give a variable to a command in shell script... santy Shell Programming and Scripting 6 08-17-2006 08:53 AM
command to give me Database magasem AIX 4 07-31-2006 05:25 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-05-2007
Registered User
 

Join Date: Mar 2007
Posts: 12
if i give this command what would be the value...

if i give dir=/tmp/${0##*/}
what would b the value stored in dir ..i'm more concerned about the 0##*/ part..
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 03-05-2007
dj -------
 

Join Date: Feb 2007
Location: Cochin, India
Posts: 322
It will chop the comple path and just provide the basename of the script
$0 is the file which you execute.

${0##*/}
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 10:54 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0