This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: File path to URI
You really should put double quotes around "$1". Cygwin of all places
ought to be an environment that reminds shellscripters to do that...
:)
On 4/30/08, Reini Urban <rurban@x-ray.at> wrote:
> > Has anyone seen a command line tool for converting path (e.g.
> /cygdrive/h/privat/news_alert.conf) to file URI
> (file:///cygdrive/h/privat/news_alert.conf)
> >
> > Yes, tweaking with string concatenation or calling some java code would
> be a way, though I would prefer some proper command within the cygwin - bash
> domain.
>
>
> $ cat > fileuri <<EOF
> echo -n "file:///"; cygpath -m $1
> EOF
>
> $ ./fileuri ~
> file:///d:/data/URBANR/My Documents
>
> --
> Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
> Problem reports: http://cygwin.com/problems.html
> Documentation: http://cygwin.com/docs.html
> FAQ: http://cygwin.com/faq/
>
>
--
Sent from Gmail for mobile | mobile.google.com
Mark J. Reed <markjreed@gmail.com>
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/