The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
echo $0 mainegate Shell Programming and Scripting 2 09-23-2007 10:34 PM
echo debasis.mishra Shell Programming and Scripting 0 03-27-2006 09:35 PM
How to set echo on siegfried Shell Programming and Scripting 1 11-17-2005 09:56 PM
echo ????? nguda UNIX for Dummies Questions & Answers 1 06-30-2003 01:02 PM
echo help bb00y High Level Programming 5 10-02-2002 05:53 PM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-16-2008
Registered User
 

Join Date: Nov 2006
Posts: 22
echo ${PWD#${PWD%/*/*}/}

Can anyone explain this in detail ...

echo ${PWD#${PWD%/*/*}/}

[PWD is the present working directory]


Thanks in Advance
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 07-16-2008
Tytalus's Avatar
Registered User
 

Join Date: Jun 2003
Location: Scotland
Posts: 218
Have a look at:

Bash Reference Manual

and here,

Code:
echo ${PWD#${PWD%/*/*}/}

is 
echo ${PWD#X/}

where X = ${PWD%/*/*}

i.e it's a split in a split....
Reply With Quote
Google UNIX.COM
Reply

Tags
bash, echo, variable expansion

Thread Tools
Display Modes




All times are GMT -7. The time now is 11:09 PM.


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