From: "Bill C. Riemers" <cygwin@docbill.net>
To: "Garrison, Jim" <jim.garrison@athensgroup.com>, <cygwin@cygwin.com>
Subject: Re: Strange cygpath/Perl 5.8 interaction?
Date: Wed, 03 Sep 2003 20:34:00 -0000 [thread overview]
Message-ID: <053001c3725a$bfe9cea0$c900000a@docbill002> (raw)
In-Reply-To: <732AC39DA54C1C4FBCBCC2F853D3AB816D16F9@athensgroup-pc9.athensgroup.com>
It is not perl adding and extra line feed. It is bash automatically
removing a line feed...
i.e.
$ echo "|"`pwd`"|"
|/tmp|
$ pwd |od -t x1
0000000 2f 74 6d 70 0a
0000005
Bash will remove the \n for you automatically when using `pwd`, perl won't.
To tell perl to remove the trailing "\n" use the chomp function.
$ perl -e 'chomp($a=`pwd`);print "|".$a."|\n";'
|/tmp|
----- Original Message -----
From: "Garrison, Jim" <jim.garrison@athensgroup.com>
To: <cygwin@cygwin.com>
Sent: Wednesday, September 03, 2003 4:13 PM
Subject: Strange cygpath/Perl 5.8 interaction?
> In bash:
>
> $ echo "\"`cygpath -w /c/temp`\""
> "c:\temp"
>
>
> But in Perl:
>
> $a = `cygpath -w /c/temp`;
> print "|$a|";
>
> produces
>
> |c:\temp
> |
>
> I.e., Perl sees an extra \n at the end of the string. I looked at
> the source for cygpath and it doesn't seem to be adding a \n, so
> I suspect the problem is an unforeseen interaction between Cygwin
> and Perl's backtick operator. Can anyone shed light on this topic?
>
> Jim Garrison
> jhg@athensgroup.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/
>
--
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/
next prev parent reply other threads:[~2003-09-03 20:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-03 20:13 Garrison, Jim
2003-09-03 20:30 ` Christopher Faylor
2003-09-03 20:34 ` Bill C. Riemers [this message]
2003-09-03 20:27 Bakken, Luke
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='053001c3725a$bfe9cea0$c900000a@docbill002' \
--to=cygwin@docbill.net \
--cc=cygwin@cygwin.com \
--cc=jim.garrison@athensgroup.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).