@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.
@echo off
set /p ="%1"<nul>temp.file
clip<temp.file
del temp.file
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
|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
I found a download here
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.
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>
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
>> 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.
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.
>> 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
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
> 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.