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: Direct/efficient way to chop off trailing \n


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


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