Re: Direct/efficient way to chop off trailing \n

2014-10-03 Thread Paul . Domaskis
Andrey Repin yandex.ru> writes: > I like bash, but it's no damned explorer, and can't be the one. > Simple for lack of visualization. My regular "shell" is > http://farmanager.com/ I would have said that bash is not a damned explorer -- rather, it's a darn good shell, which can often times be muc

Re: Direct/efficient way to chop off trailing \n

2014-10-02 Thread Andrey Repin
Greetings, Paul.Domaskis! > Andrey Repin wrote: >> Most people either use Cygwin tools in isolation, or use Cygwin >> tools from Windows tools. The opposite is rare, and mostly boils >> down to scripting, where you naturally use $(cygpath ...) to produce >> desired results. > Which I find odd. I

Re: Direct/efficient way to chop off trailing \n

2014-10-02 Thread Keith Christian
You're welcome, Paul. But I see some streamlining that could be done since I wrote that xx() alias long ago. I do like Barry's "cygpath -aw foo/bar | putclip -d" as it likely runs faster. On Thu, Oct 2, 2014 at 12:20 PM, Paul.Domaskis wrote: > Keith Christian wrote: >> This function echoes the

Re: Direct/efficient way to chop off trailing \n

2014-10-02 Thread Paul . Domaskis
Keith Christian wrote: > This function echoes the present directory to the clipboard, so that > I don't have to enter the path manually. > > I use this function in a script that sources when a bash shell is > started. Also echoes the path to the terminal for verification. > Handy for pasting dire

RE: Direct/efficient way to chop off trailing \n

2014-10-02 Thread Buchbinder, Barry (NIH/NIAID) [E]
Eric Blake sent the following at Wednesday, October 01, 2014 10:33 PM >On 10/01/2014 08:25 PM, Eliot Moss wrote: > >> You could write my solution as: >> >> echo -n `cygpath -aw foo`>/dev/clipboard > >'echo -n' is not portable (in fact, you can disable it in bash, and it >may misbehave if cygpath ou

Re: Direct/efficient way to chop off trailing \n

2014-10-01 Thread Eric Blake
On 10/01/2014 08:25 PM, Eliot Moss wrote: > You could write my solution as: > > echo -n `cygpath -aw foo`>/dev/clipboard 'echo -n' is not portable (in fact, you can disable it in bash, and it may misbehave if cygpath outputs a leading - or contains any \); it's better to use 'printf' for that pur

Re: Direct/efficient way to chop off trailing \n

2014-10-01 Thread Eliot Moss
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 so

Re: Direct/efficient way to chop off trailing \n

2014-10-01 Thread Andrey Repin
Greetings, Paul.Domaskis! > Jim, I think you're right. cygpath could benefit a lot from a -n > switch to suppress the new line. From google, however, it's actually > just li'l olde me that would benefit as no one else seems to have the > want for it. That's just happened to be opposite case of

Re: Direct/efficient way to chop off trailing \n

2014-10-01 Thread Paul . Domaskis
On 2014-10-01, Paul.Domaskis wrote: > cygpath -aw foo | tr -d '\n' > /dev/clipboard Gary Johnson wrote: > Define a function in your ~/.bashrc. > > winclip() > { > cygpath -aw "$ " | tr -d '\n' > /dev/clipboard > } > > Then just execute > > winclip TheFile Jim Garrison

Re: Direct/efficient way to chop off trailing \n

2014-10-01 Thread Gary Johnson
On 2014-10-01, Jim Garrison wrote: > On 10/1/2014 2:52 PM, Paul.Domaskis wrote: > > Running bash in a Windows environment, I often find the need to > > generate a full Windows path to a file so that I can access the file > > from a Windows app. > [snip] > >... but it does remove the trailing \n whi

Re: Direct/efficient way to chop off trailing \n

2014-10-01 Thread Keith Christian
Looks like the cygpath line was broken in two, and the closing brace isn't visibile when reading in Gmail. Readers take note of that. On Wed, Oct 1, 2014 at 4:54 PM, Keith Christian wrote: > This function echoes the present directory to the clipboard, so that I > don't have to enter the path man

Re: Direct/efficient way to chop off trailing \n

2014-10-01 Thread Keith Christian
This function echoes the present directory to the clipboard, so that I don't have to enter the path manually. I use this function in a script that sources when a bash shell is started. Also echoes the path to the terminal for verification. Handy for pasting directly into windows file dialogs. fu

Re: Direct/efficient way to chop off trailing \n

2014-10-01 Thread Jim Garrison
On 10/1/2014 2:52 PM, Paul.Domaskis wrote: > Running bash in a Windows environment, I often find the need to > generate a full Windows path to a file so that I can access the file > from a Windows app. [snip] >... but it does remove the trailing \n which chokes up > Windows. Sounds like cygpath ne

Re: Direct/efficient way to chop off trailing \n

2014-10-01 Thread Gary Johnson
On 2014-10-01, Paul.Domaskis wrote: > Running bash in a Windows environment, I often find the need to > generate a full Windows path to a file so that I can access the file > from a Windows app. > > If I use > >cygpath -aw TheFile > /dev/clipboard > > I can paste into the Windows file-opener

Direct/efficient way to chop off trailing \n

2014-10-01 Thread Paul . Domaskis
Running bash in a Windows environment, I often find the need to generate a full Windows path to a file so that I can access the file from a Windows app. If I use cygpath -aw TheFile > /dev/clipboard I can paste into the Windows file-opener without browsing. Also, I don't need to mouse around