View Single Post
  #24   Report Post  
Posted to rec.crafts.metalworking
DoN. Nichols DoN. Nichols is offline
external usenet poster
 
Posts: 2,600
Default Trepanning and Parting Off / Handling URL's

On 2008-05-05, James Waldby wrote:
On Mon, 05 May 2008 00:59:21 +0000, DoN. Nichols wrote:
On 2008-05-03, James Waldby wrote:


[ ... ]

O.K. But I normally don't have Opera up and running, so I
invoke it by a script "op" which does a cd to a place where I tend to
save things, then invokes opera via the URL which I cut-and-pasted into
the command line -- and the command line sees the newlines as end of a
command line and the start of another, which of course fails to reach
the place desired and then tries to interpret the other two as separate
commands, which also normally fail. :-) So I have to cut and paste it
one line at a time, and surround the whole thing with double quotes to
keep any stray '?', '%' or similar characters with special meanings to
the shell from having those meanings.

...

Add the following near the beginning of the script:
URL="`xclip -o | tr -d '\n'`"


Katana:dnichols 0:53:00 which xclip
xclip: Command not found.

This will set URL to the contents of the clipboard with newlines
deleted. Adapt as necessary for shells other than sh or bash.


How about for systems which don't have xclip? :-)

O.K. I've found the source, compiled and installed it without
any drama. Now to see what I can do with the script modification.

Hmm ... "Reads from standard in, or from one or more files,"

But the script is invoked as:

op URL-goes-here

and when URL occupies three lines, this would still be:

op FIRST-LINE-OF-URL (opera barfs because of incomplete URL)
SECOND-LINE-OF-URL (shell barfs, because it is expecting a new valid command)
THIRD-LINE-OF-URL (shell barfs, because it is expecting a new valid commnd)

So -- unless you can see a way to drop the cut-and-paste as
standard input for the script, I don't see how this can work.

Still -- xclip looks like an intersting tool to play with.

Thanks,
DoN.

--
Email: | Voice (all times): (703) 938-4564
(too) near Washington D.C. | http://www.d-and-d.com/dnichols/DoN.html
--- Black Holes are where God is dividing by zero ---