This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to print the full Windows path inside the sed command?


Chip Panarchy wrote:
> Hello
> 
> First I copied: cygiconv-2.dll, cygintl-3.dll, cygintl-8.dll, find.exe
> (renamed to find2.exe) & sed.exe to the %WINDIR%.

Don't do that.  Install Cygwin using setup.exe and leave the files where
setup places them.  You're asking for so much trouble doing what you
did, and it gains you virtually nothing.  What are you trying to accomplish?

> Then I ran the following command from command-prompt;
> 
> find2 . -follow -type f | sed -e "s|^\.|PATH|" -e "s|^|File:\t|"
> 
> Is there a command (from Cygwin/Linux: PATH) which I can use to print
> the full directory path?
> 
> Please tell me how I can make this command work.

The default behavior of the find program is to print out paths including
the path to the directory you are searching.  In your case, you're using
the current working directory (.), but you could give find the full path
instead.  You can run something like the following:

find path/to/my/directory -follow -type f | sed -e "s|^|File:\t|"

All file paths printed by this will have path/to/my/directory included
so there is no need to have sed try to replace (.) with some other path
string.

-Jeremy

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]