This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Direct/efficient way to chop off trailing \n
- From: Eliot Moss <moss at cs dot umass dot edu>
- To: cygwin at cygwin dot com
- Date: Wed, 01 Oct 2014 22:25:28 -0400
- Subject: Re: Direct/efficient way to chop off trailing \n
- Authentication-results: sourceware.org; auth=none
- References: <loom dot 20141001T235147-60 at post dot gmane dot org> <loom dot 20141002T011040-272 at post dot gmane dot org> <1576090815 dot 20141002032152 at yandex dot ru>
- Reply-to: moss at cs dot umass dot edu
You could write my solution as:
echo -n `cygpath -aw foo`>/dev/clipboard
though the ` (backtick) notation is deprecated these
days and $(...) is described as preferred. But for many
little things like these I write bash functions (or
aliases, when they work, which they don't here).
The echo solution has the good property that echo is
a shell built-in and so does not require spawning
another process. You had complained about speed, so
even though the echo approach does not seem to top
you list for elegance, it might for performance :-) ...
Best -- Eliot
--
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