"Relative path" option for PDIR

Nov 2, 2009
294
6
Chile
www.farah.cl
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.
 
May 29, 2008
565
4
Groton, CT
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
 
Similar threads
Thread starter Title Forum Replies Date
samintz Done Support ~ and :path in COPY Suggestions 5
D Duplicate directory path and copy files and subdirectories. Suggestions 4
mfarah Done TCEDIT: show the full name (with drive and path) of the active file on the title bar. Suggestions 3
Charles Dye TCEDIT: Path search option Suggestions 1
Emilio III Done Full path with short names Suggestions 2
R Done System variable with TCC folder path Suggestions 8
M Done Verify validity of file name and/or path... Suggestions 2
vefatica Done Option to suppress blank lines in WMIQUERY Suggestions 1
M Done SFTP with a public key auth option Suggestions 2
R Option to add tcc to Bash profile Suggestions 1
vefatica INI option to disable everything GUI ... Suggestions 7
D Suggestion: VIEW option to open VIEW over tab window but not keep it there Suggestions 0
D Done Suggestion: Add VIEW option to open in same position as current window Suggestions 0
Fross Done Option to screen center msgbox Suggestions 2
P Done Have option not to pause TCMD console output when mouse is clicked elsewhere Suggestions 0
D Done BDEBUGGER: add cmdline option to set a breakpoint at a given line Suggestions 0
vefatica Done PAUSE: option to overwrite the prompt Suggestions 2
A Declined Enhance OPTION command functionality Suggestions 2
R Declined Install option: Add File Explorer Run As Adminstrator option Suggestions 14
Charles Dye Done TCEDIT: Command-line option to print files Suggestions 2
Charles Dye Done REGDIR: Hex display option Suggestions 1
Charles Dye Done @SNAPSHOT: Add option to capture the entire virtual screen Suggestions 0
Charles Dye TASKLIST: Option to mark WOW64 processes Suggestions 0
Charles Dye Done PRINT: Option to set default printer Suggestions 0
A Declined An installer option to control .btm association Suggestions 0
Oz Solomon Done Recycle/Reuse window option for TCMD Suggestions 6
Charles Dye Done Option to prevent recursion into System subdirectories Suggestions 0
R Declined Padding option(s): @Day, @Month, @Doy Suggestions 5
L Completing the UnQLite command's option set Suggestions 0
jaejunks Done Option for case-sensitive string comparison in IF command (for CMD compatibility) Suggestions 1
rps Declined ECHO -- Add spacing option Suggestions 2
rps Declined TPIPE first match & count option Suggestions 2
rps Done Pause /wait option addition Suggestions 1
vefatica Done TIMER ... a partially quiet option Suggestions 1
D Done Add VIEW option to open in same position as current window Suggestions 0
R Done Find in screen buffer - case sensitive 'option' Suggestions 2
rconn Add option to run programs Elevated from toolbar buttons Suggestions 0
G Declined Add option to turn on file name case sensitivity Suggestions 6
M Done A suggested PDir option... Suggestions 2
Charles Dye Done New TYPE option Suggestions 0
S Declined Add /W(ipe) option to several commands Suggestions 17
S Declined New command or new ACTIVATE option request Suggestions 5
B Done PDIR Field Separator Option Request Suggestions 3
W Done Add an option to control command line parsing Suggestions 7
yjchung Declined Unblocking option for MSGBOX? Suggestions 8
E Declined Add option to use SFN for ComSpec variable Suggestions 8

Similar threads