Google グループは Usenet の新規の投稿と購読のサポートを終了しました。過去のコンテンツは引き続き閲覧できます。
Dismiss

copy argument to clipboard -- WITHOUT newline

閲覧: 1,497 回
最初の未読メッセージにスキップ

david.r...@gmail.com

未読、
2008/06/04 11:48:262008/06/04
To:
I can simplifiy my problem to that of trying to write a .bat file
which copies its argument to the clipboard WITHOUT a newline included
at the end. Here's how I'm trying to do it:

@echo off
echo %1 | clip

Unfortunately, echo seems to add a newline, which isn't acceptable.
If I can find a way to either (i) suppress the newline from echo or
(ii) by some other means pipe an argument to clip without newline, I'm
OK.

Any help appreciated. BTW, I'm looking for solutions in the batch
command-language, not in other languages such as python or perl.

foxidrive

未読、
2008/06/04 14:26:462008/06/04
To:

@echo off
set /p ="%1"<nul>temp.file
clip<temp.file
del temp.file

david.r...@gmail.com

未読、
2008/06/04 14:58:332008/06/04
To:
Thanks foxi, works very well. I find I can go a step further and
eliminate the file:
@echo off
set /p ="%1"<nul | clip

Timo Salmi

未読、
2008/06/04 15:18:242008/06/04
To:
david.r...@gmail.com wrote:
> I can simplifiy my problem to that of trying to write a .bat file
> which copies its argument to the clipboard

The copying to the clipboard makes no essential difference to the
problem.

> WITHOUT a newline included at the end.

A FAQ.

15} Is it possible to echo without linefeed like the Unix echo -n?
http://www.netikka.net/tsneti/info/tscmd015.htm

All the best, Timo

--
Prof. Timo Salmi ftp & http://garbo.uwasa.fi/ archives 193.166.120.5
Department of Accounting and Business Finance ; University of Vaasa
mailto:t...@uwasa.fi <http://www.uwasa.fi/~ts/> ; FI-65101, Finland
Timo's FAQ materials at http://www.uwasa.fi/~ts/http/tsfaq.html

billious

未読、
2008/06/07 1:10:282008/06/07
To:

|clip

doesn't work for me - XP/H SP3

Response is

"'clip' is nor recognised as an internal or external command, operable
program or batch file"


Timo Salmi

未読、
2008/06/07 3:27:132008/06/07
To:
billious <billio...@hotmail.com> wrote:
> |clip
> doesn't work for me - XP/H SP3
> Response is
> "'clip' is nor recognised as an internal or external command, operable
> program or batch file"

http://www.netikka.net/tsneti/info/tscmd067.htm

All the best, Timo

--
Prof. Timo Salmi ftp & http://garbo.uwasa.fi/ archives 193.166.120.5
Department of Accounting and Business Finance ; University of Vaasa
mailto:t...@uwasa.fi <http://www.uwasa.fi/~ts/> ; FI-65101, Finland

Useful CMD script tricks http://www.netikka.net/tsneti/info/tscmd.htm

Esra Sdrawkcab

未読、
2008/06/07 4:25:502008/06/07
To:
Timo Salmi wrote:
> billious <billio...@hotmail.com> wrote:
>> |clip
>> doesn't work for me - XP/H SP3
>> Response is
>> "'clip' is nor recognised as an internal or external command, operable
>> program or batch file"
>
> http://www.netikka.net/tsneti/info/tscmd067.htm

I found a download here


http://pericson.com/2006/03/clip-command-line-utility/

foxidrive

未読、
2008/06/07 5:54:392008/06/07
To:
On Sat, 7 Jun 2008 13:10:28 +0800, "billious" <billio...@hotmail.com>
wrote:

It's a downloadable widget:

Clip version 1.1. Copyright 1997 Microsoft Corporation.

Command-line output redirector.
Clip.exe redirects command-line output to the Windows Clipboard.

Examples:
---------
dir | clip
Places a copy of the current directory listing into the Windows clipboard.

clip < readme.txt
Places a copy of the text from readme.txt into the Windows clipboard.

Kam-Hung Soh

未読、
2008/06/08 19:17:342008/06/08
To:

GnuWin32 has a getclip & putclip pair of commands to get and put text in
the clipboard, respectively. See:

http://gnuwin32.sourceforge.net/packages/cygutils.htm

--
Kam-Hung Soh <a href="http://kamhungsoh.com/blog">Software Salariman</a>

Timo Salmi

未読、
2008/06/09 0:13:402008/06/09
To:
Kam-Hung Soh <kamhu...@gmail.com> wrote:
> Esra Sdrawkcab wrote:
>> Timo Salmi wrote:
>>> billious <billio...@hotmail.com> wrote:
>>>> |clip
>>>> doesn't work for me - XP/H SP3
>>>> Response is
>>>> "'clip' is nor recognised as an internal or external command,
>>>> operable program or batch file"
>>>
>>> http://www.netikka.net/tsneti/info/tscmd067.htm
>>
>> I found a download here
>> http://pericson.com/2006/03/clip-command-line-utility/
>
> GnuWin32 has a getclip & putclip pair of commands to get and put text in
> the clipboard, respectively. See:
> http://gnuwin32.sourceforge.net/packages/cygutils.htm

Like many other if not most of the latest Gnu utilities they are of
little use to the average XP script user since they require a separate
installation. E.g. those two won't run directly giving an error message
about a missing popt1.dll. When speaking of command line programming it
is questionable whether such utilities should be considered bona fide
ports at all. To me a true port to CLI is something that runs directly
and immediately "as is"! Other may have different preferences or views,
but that is my take.

The UnxUtils.zip and UnxUpdates.zip UNIX ports which I recently had to
withdraw from Garbo distribution were collections that did not have that
limitation. All worked as is.

About the reasons for the unfortunate withdrawal:
http://www.google.com/groups?selm=eJzZbIVxIHA.2384%40TK2MSFTNGP02.phx.gbl

Esra Sdrawkcab

未読、
2008/06/09 3:30:442008/06/09
To:

foxidrive

未読、
2008/06/09 3:59:072008/06/09
To:
On Mon, 09 Jun 2008 07:30:44 GMT, Esra Sdrawkcab <ad...@127.0.0.1> wrote:

>> The UnxUtils.zip and UnxUpdates.zip UNIX ports which I recently had to
>> withdraw from Garbo distribution were collections that did not have that
>> limitation. All worked as is.
>>
>> About the reasons for the unfortunate withdrawal:
>> http://www.google.com/groups?selm=eJzZbIVxIHA.2384%40TK2MSFTNGP02.phx.gbl
>>
>> All the best, Timo
>>
>They're still available from the source unxutils:
>http://sourceforge.net/project/showfiles.php?group_id=9328&package_id=9393&release_id=490307

It's be great to get both binary and source zips and package them as a
whole for Garbo.


Kam-Hung Soh

未読、
2008/06/09 5:24:452008/06/09
To:
Timo Salmi wrote:
> Kam-Hung Soh <kamhu...@gmail.com> wrote:
>> Esra Sdrawkcab wrote:
>>> Timo Salmi wrote:
>>>> billious <billio...@hotmail.com> wrote:
>>>>> |clip
>>>>> doesn't work for me - XP/H SP3
>>>>> Response is
>>>>> "'clip' is nor recognised as an internal or external command,
>>>>> operable program or batch file"
>>>>
>>>> http://www.netikka.net/tsneti/info/tscmd067.htm
>>>
>>> I found a download here
>>> http://pericson.com/2006/03/clip-command-line-utility/
>>
>> GnuWin32 has a getclip & putclip pair of commands to get and put text
>> in the clipboard, respectively. See:
>> http://gnuwin32.sourceforge.net/packages/cygutils.htm
>
> Like many other if not most of the latest Gnu utilities they are of
> little use to the average XP script user since they require a separate
> installation. E.g. those two won't run directly giving an error message
> about a missing popt1.dll. When speaking of command line programming it
> is questionable whether such utilities should be considered bona fide
> ports at all. To me a true port to CLI is something that runs directly
> and immediately "as is"! Other may have different preferences or views,
> but that is my take.

I had assumed that since GnuWin32 versions of sed and gawk were
mentioned in the FAQ, it would be acceptable to mention other GnuWin32
programs. I accept Timo's point and I will avoid mentioning tools that
require an installer or depend on non-standard libraries in future.

Timo Salmi

未読、
2008/06/09 5:57:232008/06/09
To:
Kam-Hung Soh <kamhu...@gmail.com> wrote:
> Timo Salmi wrote:
>> Kam-Hung Soh <kamhu...@gmail.com> wrote:
>>> GnuWin32 has a getclip & putclip pair of commands to get and put text
>>> in the clipboard, respectively. See:
>>> http://gnuwin32.sourceforge.net/packages/cygutils.htm

>> Like many other if not most of the latest Gnu utilities they are of
>> little use to the average XP script user since they require a separate
>> installation. E.g. those two won't run directly giving an error message

> I had assumed that since GnuWin32 versions of sed and gawk were
> mentioned in the FAQ,

Actually, those were the i386 compliant versions that were available in
the now removed UnxUpdates.zip collection at Garbo.

> it would be acceptable to mention other GnuWin32
> programs. I accept Timo's point and I will avoid mentioning tools that
> require an installer or depend on non-standard libraries in future.

Let's take it softer. I don't think that the information should be
hidden. But is is useful to forewarn the gentle users about the (for
some prohibitive) extra demands which part of the GnuWin32 versions make.

Anyway, the situation is baffling. I now learned from foxidrive's
posting that sourceforge.net is carrying i386 binary ports in contrast
with what came up in
http://www.google.com/groups?selm=bf57b504-6969-4944-b240-d3f75ed6f4c2%40d45g2000hsc.googlegroups.com

Scott Seligman

未読、
2008/06/09 11:34:262008/06/09
To:
Timo Salmi <t...@uwasa.fi> wrote:
>
>Anyway, the situation is baffling. I now learned from foxidrive's
>posting that sourceforge.net is carrying i386 binary ports in contrast
>with what came up in
>http://www.google.com/groups?selm=bf57b504-6969-4944-b240-d3f75ed6f4c2%40d45g2000hsc.googlegroups.com

What's baffling? SourceForge clearly has the source code available
for download.

--
--------- Scott Seligman <scott at <firstname> and michelle dot net> ---------
The most painful state of being is remembering the future, especially
one which you know will never come.
-- Soren Kierkegaard

Timo Salmi

未読、
2008/06/09 13:37:292008/06/09
To:
Scott Seligman <seli...@example.com> wrote:
> Timo Salmi <t...@uwasa.fi> wrote:
>> Anyway, the situation is baffling. I now learned from foxidrive's
>> posting that sourceforge.net is carrying i386 binary ports in contrast
>> with what came up in
>> http://www.google.com/groups?selm=bf57b504-6969-4944-b240-d3f75ed6f4c2%40d45g2000hsc.googlegroups.com

> What's baffling? SourceForge clearly has the source code available
> for download.

I'll answer that question about what is baffling. Where is the deciding
dividing line? Is it ok to have the binaries in a separate package as
long as the source code is 1) within the same package (which is not the
case!) 2) in the same directory at the same site 3) elsewhere on the
same repository 4) somewhere on the net as long as linked on the
distribution page? Even when and if there is no pointer to anything or
any documentation within the binaries package!? Why is that supposed to
be ok if done by one repository (SourceForge) but not when done by
another (Garbo)? What does Gnu license actually mean under the
circumstances? What constitutes the "source availability"? What a can of
worms. :-)

At Garbo UnxUtils.zip contained the required material, but the
accompanying UnxUpdates.zip did not. Nor does the UnxUpdates.zip still
carried elsewhere have the information. It would be nice to hear here
clearly from someone on the Gnu project what is allowed and desirable
and what not. On the other hand, why would I bother with such detective
work? The distribution of the packages from Garbo is not within (nor
against, for that matter) my own interests. So I am steering clear of a
potential controversy ... and remain baffled by the setup. Fortunately,
not truly my problem to cater the users. Especially when a respected net
person like Harlan Grove kindly and resolutely explains that I am
(actually, now was) violating the Gnu license by having (also)
UnxUpdates.zip on Garbo.

Even if it is a separate matter, what also baffles me (as I wrote
earlier) is what is the sense of _supposedly_ portable command line
utilities, which require a Windows installing before they work. That is
not genuine portability in my books. UnxUtils.zip and UnxUpdates.zip do
not have this problem while the up-to-date GnuWin32 mostly do.

新着メール 0 件