Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

"Relative path" option for PDIR

Nov
344
10
Let's say that I have the following output from pdir:

C:\Users\Miguel\Documents\example>pdir /S/(fpn) *.txt
C:\Users\Miguel\Documents\example\test.txt
C:\Users\Miguel\Documents\example\deeper\cafest.txt
C:\Users\Miguel\Documents\example\deeper\even\matest.txt
C:\Users\Miguel\Documents\example\deeper\even\deeper\tilest.txt


I'd like to have a new option to display the relative path to wherever the disk's current directory is. The output from the above example would become:

C:\Users\Miguel\Documents\example>pdir /S/(fXn) *.txt
.\test.txt
.\deeper\cafest.txt
.\deeper\even\matest.txt
.\deeper\even\deeper\tilest.txt


Thanks.
 
If you have SED.EXE on your system, you can use this as a workaround:
Code:
pdir /S/(fpn) *.txt |! sed -e "s/%@replace[\,\\,%_cwd]/./g"
E.g.,
Code:
~\Work> pdir /(fpn) *.txt |! sed -e "s/%@replace[\,\\,%_cwd]/./g"
.\2009taxestimate.txt
.\abc.txt
.\activatelist.txt
.\agedatelist.txt
 
Back
Top
[FOX] Ultimate Translator
Translate