public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: running mks toolkit and cygwin on same machine
@ 2002-07-09 22:12 Robert Collins
  2002-07-09 22:14 ` Christopher Faylor
  2002-07-10  9:28 ` Nicholas Wourms
  0 siblings, 2 replies; 31+ messages in thread
From: Robert Collins @ 2002-07-09 22:12 UTC (permalink / raw)
  To: cygwin; +Cc: Randall R Schulz, Thomas Baker

Why not just roll-your own 'rev'?

Included is a trivial 'rev.cc' that will handle any size argument list that
cygwin is able to pass it. It should include <algorithm> to support gcc 3.1,
but for some reason it couldn't process templates when I included that.
Sigh.

Compile with
g++ -o rev.exe rev.cc

Rob

====
// Licenced under the GNU General Public Licence version 2.0 or greater, a
copy of which can be obtained
// from http://www.gnu.org
//
// Copyright (c) 2002 Robert Collins.

#include <vector>
#include <iostream>
#include <algo.h>

template <class T> struct print : public unary_function<T, void>
{
  print(ostream& out) : os(out) {}
  void operator() (T x) { os << x << ' '; }
  ostream& os;
};

int main (int argc, char **argv)
{
  vector <char *> args;
  // assumes argv[0] is this process. This can be incorrect with some uses
  // of exec, but should be fine for shell scripts
  for (int n=1; n < argc; ++n)
    args.push_back (argv[n]);
  for_each (args.rbegin() ,args.rend (), print<char *>(cout));
}
===


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: running mks toolkit and cygwin on same machine
  2002-07-09 22:12 running mks toolkit and cygwin on same machine Robert Collins
@ 2002-07-09 22:14 ` Christopher Faylor
  2002-07-09 23:22   ` Robert Collins
  2002-07-10  8:13   ` Charles Wilson
  2002-07-10  9:28 ` Nicholas Wourms
  1 sibling, 2 replies; 31+ messages in thread
From: Christopher Faylor @ 2002-07-09 22:14 UTC (permalink / raw)
  To: cygwin

On Wed, Jul 10, 2002 at 02:48:52PM +1000, Robert Collins wrote:
>Why not just roll-your own 'rev'?
>
>Included is a trivial 'rev.cc' that will handle any size argument list that
>cygwin is able to pass it. It should include <algorithm> to support gcc 3.1,
>but for some reason it couldn't process templates when I included that.
>Sigh.
>
>Compile with
>g++ -o rev.exe rev.cc

Sounds like a candidate for cygutils...

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: running mks toolkit and cygwin on same machine
  2002-07-09 22:14 ` Christopher Faylor
@ 2002-07-09 23:22   ` Robert Collins
  2002-07-10  8:13   ` Charles Wilson
  1 sibling, 0 replies; 31+ messages in thread
From: Robert Collins @ 2002-07-09 23:22 UTC (permalink / raw)
  To: cygwin


----- Original Message -----
From: "Christopher Faylor" <cgf@redhat.com>
Sent: Wednesday, July 10, 2002 2:51 PM


> On Wed, Jul 10, 2002 at 02:48:52PM +1000, Robert Collins wrote:
> >Why not just roll-your own 'rev'?
..
> >Compile with
> >g++ -o rev.exe rev.cc
>
> Sounds like a candidate for cygutils...

Fine by me. It's probably even codeable in bash/ash scripting, but I'm not a
shell guru.
And, it's hardly likely to require maintenance :}.

Rob


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: running mks toolkit and cygwin on same machine
  2002-07-09 22:14 ` Christopher Faylor
  2002-07-09 23:22   ` Robert Collins
@ 2002-07-10  8:13   ` Charles Wilson
  2002-07-10  8:19     ` Charles Wilson
  2002-07-10  8:37     ` Conrad Scott
  1 sibling, 2 replies; 31+ messages in thread
From: Charles Wilson @ 2002-07-10  8:13 UTC (permalink / raw)
  To: cygwin



Christopher Faylor wrote:

> On Wed, Jul 10, 2002 at 02:48:52PM +1000, Robert Collins wrote:
> 
>>Why not just roll-your own 'rev'?
>>
>>Included is a trivial 'rev.cc' that will handle any size argument list that
>>cygwin is able to pass it. It should include <algorithm> to support gcc 3.1,
>>but for some reason it couldn't process templates when I included that.
>>Sigh.
>>
>>Compile with
>>g++ -o rev.exe rev.cc
>>
> 
> Sounds like a candidate for cygutils...



Yes, it's been on my todo list for some time.  Here are the util-linux 
progs that I believe still need to be added to cygutils:

colcrt  - filter nroff output for CRT previewing
colrm   - remove columns from a file
column  - columnate lists
rev     - reverses the characters on each line of each file
mcookie - generates magic cookies for Xauth

I have the util-linux code for each of this, plus man pages.  I just 
need to munge them up so they build within cygutils...time, time, time...

--Chuck




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: running mks toolkit and cygwin on same machine
  2002-07-10  8:13   ` Charles Wilson
@ 2002-07-10  8:19     ` Charles Wilson
  2002-07-10  8:37     ` Conrad Scott
  1 sibling, 0 replies; 31+ messages in thread
From: Charles Wilson @ 2002-07-10  8:19 UTC (permalink / raw)
  To: cygwin



Christopher Faylor wrote:

> On Wed, Jul 10, 2002 at 02:48:52PM +1000, Robert Collins wrote:
> 
>>Why not just roll-your own 'rev'?
>>
>>Included is a trivial 'rev.cc' that will handle any size argument list that
>>cygwin is able to pass it. It should include <algorithm> to support gcc 3.1,
>>but for some reason it couldn't process templates when I included that.
>>Sigh.
>>
>>Compile with
>>g++ -o rev.exe rev.cc
>>
> 
> Sounds like a candidate for cygutils...



Yes, it's been on my todo list for some time.  Here are the util-linux 
progs that I believe still need to be added to cygutils:

colcrt  - filter nroff output for CRT previewing
colrm   - remove columns from a file
column  - columnate lists
rev     - reverses the characters on each line of each file
mcookie - generates magic cookies for Xauth

I have the util-linux code for each of this, plus man pages.  I just 
need to munge them up so they build within cygutils...time, time, time...

--Chuck



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: running mks toolkit and cygwin on same machine
  2002-07-10  8:13   ` Charles Wilson
  2002-07-10  8:19     ` Charles Wilson
@ 2002-07-10  8:37     ` Conrad Scott
  2002-07-10  9:19       ` Charles Wilson
  1 sibling, 1 reply; 31+ messages in thread
From: Conrad Scott @ 2002-07-10  8:37 UTC (permalink / raw)
  To: cygwin

"Charles Wilson" <cwilson@ece.gatech.edu> wrote:
> Yes, it's been on my todo list for some time.
> Here are the util-linux progs that I believe
> still need to be added to cygutils:
>
[snip]

Would the cygutils package be a suitable home for two other
util-linux programs: ipcs and ipcrm?

I have these now compiled and working against the cygwin_daemon
branch.  Since these presumably aren't going to be part of the
cygwin package and I'm loath to create a package just for these
two utilities, I'm keen to find some other existing package in
which to lose them.  They're unlikely to need much support (once
I've hacked them up properly).

// Conrad




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: running mks toolkit and cygwin on same machine
  2002-07-10  8:37     ` Conrad Scott
@ 2002-07-10  9:19       ` Charles Wilson
  2002-07-10  9:26         ` Conrad Scott
  0 siblings, 1 reply; 31+ messages in thread
From: Charles Wilson @ 2002-07-10  9:19 UTC (permalink / raw)
  To: cygwin



Conrad Scott wrote:

> "Charles Wilson" <cwilson@ece.gatech.edu> wrote:
> 
>>Yes, it's been on my todo list for some time.
>>Here are the util-linux progs that I believe
>>still need to be added to cygutils:
>>
>>
> [snip]
> 
> Would the cygutils package be a suitable home for two other
> util-linux programs: ipcs and ipcrm?
> 
> I have these now compiled and working against the cygwin_daemon
> branch.  Since these presumably aren't going to be part of the
> cygwin package and I'm loath to create a package just for these
> two utilities, I'm keen to find some other existing package in
> which to lose them.  They're unlikely to need much support (once
> I've hacked them up properly).


Yes, Robert and I have talked about that in the past.  cygipc includes 
them, but once cygdaemon is official I'll add them to cygutils.

Currently, cygutils includes a few IPC test programs (but not ipcrm or 
ipcs) -- but those are only built if cygipc is installed, are are not 
included in "official" cygutils package since cygipc isn't official.

If you can
   1) give me the code -- see cygutils' HOW-TO-CONTRIBUTE document
   2) also come up with an m4 macro for configure.in that I can use to 
detect the presence of a cygserver-capable cygwin1.dll

Then I have no problems adding ipcs and ipcrm to cygutils BEFORE 
cygserver goes gold.

--Chuck




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: running mks toolkit and cygwin on same machine
  2002-07-10  9:19       ` Charles Wilson
@ 2002-07-10  9:26         ` Conrad Scott
  0 siblings, 0 replies; 31+ messages in thread
From: Conrad Scott @ 2002-07-10  9:26 UTC (permalink / raw)
  To: cygwin

"Charles Wilson" <cwilson@ece.gatech.edu> wrote:
> If you can
>    1) give me the code -- see cygutils' HOW-TO-CONTRIBUTE
>     document
>    2) also come up with an m4 macro for configure.in that
>     I can use to detect the presence of a cygserver-capable
>     cygwin1.dll
>
> Then I have no problems adding ipcs and ipcrm to cygutils BEFORE
> cygserver goes gold.

Thanks, that's good.  I'll put that together once I've fixed up
ipcs and ipcrm right and proper.

// Conrad




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: running mks toolkit and cygwin on same machine
  2002-07-09 22:12 running mks toolkit and cygwin on same machine Robert Collins
  2002-07-09 22:14 ` Christopher Faylor
@ 2002-07-10  9:28 ` Nicholas Wourms
  1 sibling, 0 replies; 31+ messages in thread
From: Nicholas Wourms @ 2002-07-10  9:28 UTC (permalink / raw)
  To: cygwin

--- Robert Collins <robert.collins@syncretize.net> wrote:
> Why not just roll-your own 'rev'?
> 
> Included is a trivial 'rev.cc' that will handle any size argument list
> that
> cygwin is able to pass it. It should include <algorithm> to support gcc
> 3.1,
> but for some reason it couldn't process templates when I included that.
> Sigh.
> 
> Compile with
> g++ -o rev.exe rev.cc
> 
> Rob
Robert,

Perhaps this is another miscellaneous utility best suited for inclusion in
cygutils?

Cheers,
Nicholas

P.S. - This may already get ask later in the thread, but I'm hacking
through 100 messages now after being on haitus for most of yesterday...

__________________________________________________
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: running mks toolkit and cygwin on same machine
  2002-07-10  6:39         ` Thomas Baker
  2002-07-10  8:00           ` Charles Wilson
@ 2002-07-10 22:47           ` scowles
  1 sibling, 0 replies; 31+ messages in thread
From: scowles @ 2002-07-10 22:47 UTC (permalink / raw)
  To: cygwin


Wednesday, July 10, 2002, 6:17:28 AM, you wrote:

TB> On Tue, Jul 09, 2002 at 10:02:38PM -0700, scowles@earthlink.net wrote:
>> TB>     more      - sometimes I do not want the text to disappear from
>> TB>                 the screen on exit
>> 
>> /bin/more is part of cygwin on my system (current as of 2 hours ago,
>> full install).

TB> I do not see it in the Cygwin Setup Select Packages list.  Is it an
TB> alias of less?

see below,

sid


02-07-10
20:01:32 [512] BUBO5:ftp%3a%2f%2fftp.easynet.be%2fcygwin/release% /bin/ls -l ./less ./more
./less:
total 262
-rwx------    1 scowles  None       192974 Jun 15 14:40 less-374-1-src.tar.bz2
-rw-rw-rw-    1 scowles  None         5522 Jun 17 20:56 less-374-1-src.tarls
-rwx------    1 scowles  None        66831 Jun 12 18:09 less-374-1.tar.bz2
-rw-rw-rw-    1 scowles  None          597 Jun 17 20:56 less-374-1.tarls

./more:
total 16
-rwx------    1 scowles  None        15151 Jun 12 18:09 more-2.11o-1.tar.bz2
-rw-rw-rw-    1 scowles  None          398 Jun 17 20:56 more-2.11o-1.tarls
02-07-10
20:02:03 [513] BUBO5:ftp%3a%2f%2fftp.easynet.be%2fcygwin/release%


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: running mks toolkit and cygwin on same machine
  2002-07-10  8:26 ` Charles Wilson
@ 2002-07-10  8:36   ` Charles Wilson
  0 siblings, 0 replies; 31+ messages in thread
From: Charles Wilson @ 2002-07-10  8:36 UTC (permalink / raw)
  To: cygwin; +Cc: cygwin



John Vincent wrote:

> Hi,
> 
> I guess you'll hate me for mentioning this, but if
> it's going into cygutils, please implement the
> options --help and --version to do the obvious things.
> 
> Unless you're going to do a couple of pages of text for
> info/man etc. :-))


util-linux's rev doesn't support any options.  However, the man page is 
copied below:

--Chuck

REV(1)                  System General Commands Manual 
REV(1)

NAME
      rev - reverse lines of a file

SYNOPSIS
      rev [file]

DESCRIPTION
      The rev utility copies the specified files to the standard output,
      reversing the order of characters in every line.  If no files are 
speci-
      fied, the standard input is read.

BSD                             March 21, 1992 
    BSD




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: running mks toolkit and cygwin on same machine
  2002-07-10  0:32       ` Jon LaBadie
@ 2002-07-10  8:26         ` Charles Wilson
  0 siblings, 0 replies; 31+ messages in thread
From: Charles Wilson @ 2002-07-10  8:26 UTC (permalink / raw)
  To: cygwin; +Cc: Thomas Baker



Jon LaBadie wrote:

> On Wed, Jul 10, 2002 at 06:02:25AM +0200, Thomas Baker wrote:
> 
> 
>>    rev       - reverse order of characters in a line
>>
> 
> Included in the AT&T "ast" package for cygwin.


as of right now, the AT&T "ast" package isn't an official cygwin package 
(e.g. installable by setup).  That may change, eventually.

--Chuck





--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: running mks toolkit and cygwin on same machine
  2002-07-10  4:48 John Vincent
@ 2002-07-10  8:26 ` Charles Wilson
  2002-07-10  8:36   ` Charles Wilson
  0 siblings, 1 reply; 31+ messages in thread
From: Charles Wilson @ 2002-07-10  8:26 UTC (permalink / raw)
  To: John Vincent; +Cc: cygwin



John Vincent wrote:

> Hi,
> 
> I guess you'll hate me for mentioning this, but if
> it's going into cygutils, please implement the
> options --help and --version to do the obvious things.
> 
> Unless you're going to do a couple of pages of text for
> info/man etc. :-))


util-linux's rev doesn't support any options.  However, the man page is 
copied below:

--Chuck

REV(1)                  System General Commands Manual 
REV(1)

NAME
      rev - reverse lines of a file

SYNOPSIS
      rev [file]

DESCRIPTION
      The rev utility copies the specified files to the standard output,
      reversing the order of characters in every line.  If no files are 
speci-
      fied, the standard input is read.

BSD                             March 21, 1992 
    BSD



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: running mks toolkit and cygwin on same machine
  2002-07-10  6:39         ` Thomas Baker
@ 2002-07-10  8:00           ` Charles Wilson
  2002-07-10 22:47           ` scowles
  1 sibling, 0 replies; 31+ messages in thread
From: Charles Wilson @ 2002-07-10  8:00 UTC (permalink / raw)
  To: cygwin

Thomas Baker wrote:

> I do not see it in the Cygwin Setup Select Packages list.  Is it an
> alias of less?


No, it's a actual, standalone package.  You probably need to click on 
the 'Full' button.

--Chuck




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: running mks toolkit and cygwin on same machine
  2002-07-09 23:02       ` scowles
  2002-07-10  6:39         ` Thomas Baker
@ 2002-07-10  7:50         ` Charles Wilson
  1 sibling, 0 replies; 31+ messages in thread
From: Charles Wilson @ 2002-07-10  7:50 UTC (permalink / raw)
  To: scowles; +Cc: cygwin

[-- Attachment #1: Type: text/plain, Size: 2111 bytes --]

scowles@earthlink.net wrote:

> TB> Though Cygwin seems to have left MKS in the dust for most
> TB> of the functions I am interested in -- vim vs. vi, mutt
> TB> vs. mailx, fetchmail vs. something-that-didn't-work-for-me,
> TB> procmail vs. nothing -- there are a few commands that I still
> TB> use in their MKS versions:
> 
> TB>     cpio      - is this out of fashion now, or what?
> 
> yes, it is.  the big difference between cpio and tar in ages past was
> that cpio could handle devices.  (arguably, complete lists in
> configuration management are handled much easier by cpio's stdin
> filename input method).  however, gnutar now handles devices just as well.
> in addition, gnutar handles major compression techniques internally.
> source for gnu cpio (i have used ver. 2.4.2 for years) is readily
> available and compiles ootb on cygwin.  it handles all of my ancient
> archives from multiple platforms.


Yeah, but cpio is still valuable for mucking with rpm's.  I often do 
this, when I want to extract code without installing the rpm...

rpm2cpio foo.rpm | cpio -i --make-directories

Granted, we don't have rpm yet, so...


> TB>     flip      - changes CRLF endings; no equivalent in Cygwin?
> 
> easy to do in any shell:  invoke /bin/tr to do the translation
> you need.  e.g.  for cr to lf:  cat $file | /bin/tr '\015' '\


d2u and u2d are already in the cygutils package.


> TB>     more      - sometimes I do not want the text to disappear from
> TB>                 the screen on exit
> 
> /bin/more is part of cygwin on my system (current as of 2 hours ago,
> full install).


Yep.  But don't use it -- less is much better.

> 
> TB>     rev       - reverse order of characters in a line
> 


This is on my TODO list for cygutils.  On linux, it is part of the 
util-linux package, a grab bag of random small utilities.  On cygwin, 
cygutils is the grab bag of random small utilities: hence...

I've attached the util-linux source for rev.c -- it's a bit more complex 
(complete?) than some of the other implementations...I'll probably use 
it as the basis for cygutils' version.

--Chuck


[-- Attachment #2: rev.c --]
[-- Type: text/plain, Size: 4537 bytes --]

/*-
 * Copyright (c) 1987, 1992 The Regents of the University of California.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *	This product includes software developed by the University of
 *	California, Berkeley and its contributors.
 * 4. Neither the name of the University nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 * Modified for Linux by Charles Hannum (mycroft@gnu.ai.mit.edu)
 *                   and Brian Koehmstedt (bpk@gnu.ai.mit.edu)
 *
 * Wed Sep 14 22:26:00 1994: Patch from bjdouma <bjdouma@xs4all.nl> to handle
 *                           last line that has no newline correctly.
 * 3-Jun-1998: Patched by Nicolai Langfeldt to work better on Linux:
 * 	Handle any-length-lines.  Code copied from util-linux' setpwnam.c
 * 1999-02-22 Arkadiusz Mi¶kiewicz <misiek@pld.ORG.PL>
 * 	added Native Language Support
 * 1999-09-19 Bruno Haible <haible@clisp.cons.org>
 * 	modified to work correctly in multi-byte locales
 *
 */

#include <stdarg.h>
#include <sys/types.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "nls.h"

#include "widechar.h"

void usage(void);
void warn(const char *, ...);

int
main(int argc, char *argv[])
{
  register char *filename;
  register wchar_t *t;
  size_t buflen = 512;
  wchar_t *p = malloc(buflen*sizeof(wchar_t));
  size_t len;
  FILE *fp;
  int ch, rval;

  setlocale(LC_ALL, "");
  bindtextdomain(PACKAGE, LOCALEDIR);
  textdomain(PACKAGE);

  while ((ch = getopt(argc, argv, "")) != EOF)
    switch(ch) {
    case '?':
    default:
      usage();
    }

  argc -= optind;
  argv += optind;

  fp = stdin;
  filename = "stdin";
  rval = 0;
  do {
    if (*argv) {
      if ((fp = fopen(*argv, "r")) == NULL) {
	warn("%s: %s", *argv, strerror(errno));
	rval = 1;
	++argv;
	continue;
      }
      filename = *argv++;
    }

    while (fgetws(p, buflen, fp)) {

      len = wcslen(p);

      /* This is my hack from setpwnam.c -janl */
      while (p[len-1] != '\n' && !feof(fp)) {
	/* Extend input buffer if it failed getting the whole line */

	/* So now we double the buffer size */
	buflen *= 2;

	p = realloc(p, buflen*sizeof(wchar_t));
	if (p == NULL) {
	  fprintf(stderr,_("Unable to allocate bufferspace\n"));
	  exit(1);
	}

	/* And fill the rest of the buffer */
	if (fgetws(&p[len], buflen/2, fp) == NULL) break;

	len = wcslen(p);
      
	/* That was a lot of work for nothing.  Gimme perl! */
      }
		  
      t = p + len - 1 - (*(p+len-1)=='\r' || *(p+len-1)=='\n');
      for ( ; t >= p; --t)
	if (*t != 0)
	  putwchar(*t);
      putwchar('\n');
    }
    fflush(fp);
    if (ferror(fp)) {
      warn("%s: %s", filename, strerror(errno));
      rval = 1;
    }
    if (fclose(fp))
      rval = 1;
  } while(*argv);
  exit(rval);
}

void
warn(const char *fmt, ...)
{
	va_list ap;
	va_start(ap, fmt);
	(void)fprintf(stderr, "rev: ");
	(void)vfprintf(stderr, fmt, ap);
	va_end(ap);
	(void)fprintf(stderr, "\n");
}

void
usage(void)
{
	(void)fprintf(stderr, _("usage: rev [file ...]\n"));
	exit(1);
}


[-- Attachment #3: Type: text/plain, Size: 214 bytes --]

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: running mks toolkit and cygwin on same machine
  2002-07-10  6:49           ` David Starks-Browning
@ 2002-07-10  7:49             ` Thomas Baker
  0 siblings, 0 replies; 31+ messages in thread
From: Thomas Baker @ 2002-07-10  7:49 UTC (permalink / raw)
  To: David Starks-Browning; +Cc: cygwin

On Wed, Jul 10, 2002 at 02:26:24PM +0100, David Starks-Browning wrote:
>        -X or --no-init
>               Disables sending  the  termcap  initialization  and
>               deinitialization  strings to the terminal.  This is
>               sometimes desirable if the deinitialization  string
>               does   something  unnecessary,  like  clearing  the
>               screen.

Thanks David, I never would have caught that...

> I have:
> 
> 	export LESS=-X
>
> in my .bashrc.
> 
> Hopefully you now have no reason to use "more" instead of "less"!

No reason no more indeed,
Tom

-- 
Dr. Thomas Baker                                Thomas.Baker@bi.fhg.de
Institutszentrum Schloss Birlinghoven          mobile +49-171-408-5784
Fraunhofer-Gesellschaft                          work +49-30-8109-9027
53754 Sankt Augustin, Germany                    fax +49-2241-144-1408

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: running mks toolkit and cygwin on same machine
  2002-07-10  6:48       ` Thomas Baker
@ 2002-07-10  7:26         ` Randall R Schulz
  0 siblings, 0 replies; 31+ messages in thread
From: Randall R Schulz @ 2002-07-10  7:26 UTC (permalink / raw)
  To: Thomas Baker, cygwin

Tom,

Only NTFS file systems support hard links. Symlinks work on all file systems.

I presume that the symlinks used for command aliases in Setup.exe's 
packages are present in the tarballs themselves, with no extra work (beyond 
embodying the Cygwin tar code or an equivalent) required by Setup.exe. 
That's one of the things about Cygwin TAR that makes it a requirement when 
dealing with TAR archives bearing such Unix TAR features and why other 
"compatible" TAR processors aren't suitable.

Randall


At 06:21 2002-07-10, Thomas Baker wrote:
> > Why?  Works fine for me.  But a hard link of egrep.exe
> > and grep.exe (and fgrep.exe) rather than symlink of
> > egrep -> grep.exe (no .exe) might help.
>
>Hmm, I did not make any links, so assume that setup.exe
>did this:
>
>lrwxrwxrwx    1 Administ       15 May 22 17:53 /usr/bin/egrep -> grep
>
>..and that there must be a good reason why hard links are
>not the default for such things.  Will give this a try when I
>get a chance to read up on what "links" mean under WIN2000...
>
>Thanks,
>Tom


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: running mks toolkit and cygwin on same machine
  2002-07-10  6:35         ` Thomas Baker
@ 2002-07-10  6:49           ` David Starks-Browning
  2002-07-10  7:49             ` Thomas Baker
  0 siblings, 1 reply; 31+ messages in thread
From: David Starks-Browning @ 2002-07-10  6:49 UTC (permalink / raw)
  To: Thomas Baker; +Cc: cygwin

On Wednesday 10 Jul 02, Thomas Baker writes:
> I know "less" is better, but sometimes I don't want the output
> to disappear when I exit the pager back to the prompt -- as
> when I have just successfully grepped for an email address.
> Didn't see any flags for that in less (or vim, for that
> matter).

From less(1) man page:

       -X or --no-init
              Disables sending  the  termcap  initialization  and
              deinitialization  strings to the terminal.  This is
              sometimes desirable if the deinitialization  string
              does   something  unnecessary,  like  clearing  the
              screen.

I have:

	export LESS=-X

in my .bashrc.

Hopefully you now have no reason to use "more" instead of "less"!

Regards,
David


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: running mks toolkit and cygwin on same machine
  2002-07-10  0:14     ` Jon LaBadie
@ 2002-07-10  6:48       ` Thomas Baker
  2002-07-10  7:26         ` Randall R Schulz
  0 siblings, 1 reply; 31+ messages in thread
From: Thomas Baker @ 2002-07-10  6:48 UTC (permalink / raw)
  To: cygwin, Jon LaBadie

On Wed, Jul 10, 2002 at 02:22:39AM -0400, Jon LaBadie wrote:
> On Wed, Jul 10, 2002 at 05:40:39AM +0200, Thomas Baker wrote:
> > I also installed the ATT ksh -- there was a thread about this
> > two or three weeks ago -- but understand that a KSH package
> > for the standard Cygwin setup is on the way.  Have also had
> > some small problems porting scripts, one of which being that
> > "egrep" must always be changed to "grep -E".
> 
> Why?  Works fine for me.  But a hard link of egrep.exe
> and grep.exe (and fgrep.exe) rather than symlink of
> egrep -> grep.exe (no .exe) might help.

Hmm, I did not make any links, so assume that setup.exe
did this:

lrwxrwxrwx    1 Administ       15 May 22 17:53 /usr/bin/egrep -> grep

..and that there must be a good reason why hard links are
not the default for such things.  Will give this a try when I
get a chance to read up on what "links" mean under WIN2000...

Thanks,
Tom

-- 
Dr. Thomas Baker                                Thomas.Baker@bi.fhg.de
Institutszentrum Schloss Birlinghoven          mobile +49-171-408-5784
Fraunhofer-Gesellschaft                          work +49-30-8109-9027
53754 Sankt Augustin, Germany                    fax +49-2241-144-1408

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: running mks toolkit and cygwin on same machine
  2002-07-09 23:02       ` scowles
@ 2002-07-10  6:39         ` Thomas Baker
  2002-07-10  8:00           ` Charles Wilson
  2002-07-10 22:47           ` scowles
  2002-07-10  7:50         ` Charles Wilson
  1 sibling, 2 replies; 31+ messages in thread
From: Thomas Baker @ 2002-07-10  6:39 UTC (permalink / raw)
  To: cygwin

On Tue, Jul 09, 2002 at 10:02:38PM -0700, scowles@earthlink.net wrote:
> TB>     more      - sometimes I do not want the text to disappear from
> TB>                 the screen on exit
> 
> /bin/more is part of cygwin on my system (current as of 2 hours ago,
> full install).

I do not see it in the Cygwin Setup Select Packages list.  Is it an
alias of less?

Tom

-- 
Dr. Thomas Baker                                Thomas.Baker@bi.fhg.de
Institutszentrum Schloss Birlinghoven          mobile +49-171-408-5784
Fraunhofer-Gesellschaft                          work +49-30-8109-9027
53754 Sankt Augustin, Germany                    fax +49-2241-144-1408

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: running mks toolkit and cygwin on same machine
  2002-07-09 22:09       ` Randall R Schulz
@ 2002-07-10  6:35         ` Thomas Baker
  2002-07-10  6:49           ` David Starks-Browning
  0 siblings, 1 reply; 31+ messages in thread
From: Thomas Baker @ 2002-07-10  6:35 UTC (permalink / raw)
  To: Randall R Schulz; +Cc: cygwin

Thanks, Randall!  I'm three steps closer to a purely Cygwin 
environment.

On Tue, Jul 09, 2002 at 09:31:01PM -0700, Randall R Schulz wrote:
> - flip
>    Use dos2unix and unix2dos

$ man dos2unix
No manual entry for dos2unix 

Also not in setup.exe??

> - more
>    Available, as is "less" a superior alternative

I know "less" is better, but sometimes I don't want the output
to disappear when I exit the pager back to the prompt -- as
when I have just successfully grepped for an email address.
Didn't see any flags for that in less (or vim, for that
matter).  Not a big deal, can always "| cat"...

Tom

-- 
Dr. Thomas Baker                                Thomas.Baker@bi.fhg.de
Institutszentrum Schloss Birlinghoven          mobile +49-171-408-5784
Fraunhofer-Gesellschaft                          work +49-30-8109-9027
53754 Sankt Augustin, Germany                    fax +49-2241-144-1408

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: running mks toolkit and cygwin on same machine
  2002-07-09 20:30 ` Paul Coltrin
  2002-07-09 21:49   ` Thomas Baker
@ 2002-07-10  5:00   ` Jason Tishler
  1 sibling, 0 replies; 31+ messages in thread
From: Jason Tishler @ 2002-07-10  5:00 UTC (permalink / raw)
  To: cygwin

Paul,

On Tue, Jul 09, 2002 at 05:35:09PM +0000, Paul Coltrin wrote:
> I am finding that converting scripts from MKS ksh to Cygwin/ATT ksh
> is not trivial.

I'm trying to wean co-workers off of MKS myself.  Would you be willing
to post the issues that you have under covered so far?

Thanks,
Jason

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: running mks toolkit and cygwin on same machine
@ 2002-07-10  4:48 John Vincent
  2002-07-10  8:26 ` Charles Wilson
  0 siblings, 1 reply; 31+ messages in thread
From: John Vincent @ 2002-07-10  4:48 UTC (permalink / raw)
  To: robert.collins; +Cc: cygwin

Hi,

I guess you'll hate me for mentioning this, but if
it's going into cygutils, please implement the
options --help and --version to do the obvious things.

Unless you're going to do a couple of pages of text for
info/man etc. :-))


/John Vincent.


>----- Original Message -----
>From: "Christopher Faylor" <cgf@redhat.com>
>Sent: Wednesday, July 10, 2002 2:51 PM
>
>
>
>>On Wed, Jul 10, 2002 at 02:48:52PM +1000, Robert Collins wrote:
>> >Why not just roll-your own 'rev'?
>..
>> >Compile with
>> >g++ -o rev.exe rev.cc
>>
>>Sounds like a candidate for cygutils...
>
>Fine by me. It's probably even codeable in bash/ash scripting, but I'm >not 
>a
>shell guru.
>And, it's hardly likely to require maintenance :}.
>
>Rob
>


_________________________________________________________________
Join the worldÂ’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: running mks toolkit and cygwin on same machine
  2002-07-09 21:59     ` Thomas Baker
  2002-07-09 22:09       ` Randall R Schulz
  2002-07-09 23:02       ` scowles
@ 2002-07-10  0:32       ` Jon LaBadie
  2002-07-10  8:26         ` Charles Wilson
  2 siblings, 1 reply; 31+ messages in thread
From: Jon LaBadie @ 2002-07-10  0:32 UTC (permalink / raw)
  To: cygwin; +Cc: Thomas Baker

On Wed, Jul 10, 2002 at 06:02:25AM +0200, Thomas Baker wrote:

>     rev       - reverse order of characters in a line

Included in the AT&T "ast" package for cygwin.

-- 
Jon H. LaBadie                  jcyg@jgcomp.com
 JG Computing
 4455 Province Line Road        (609) 252-0159
 Princeton, NJ  08540-4322      (609) 683-7220 (fax)

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: running mks toolkit and cygwin on same machine
  2002-07-09 21:49   ` Thomas Baker
  2002-07-09 21:59     ` Thomas Baker
@ 2002-07-10  0:14     ` Jon LaBadie
  2002-07-10  6:48       ` Thomas Baker
  1 sibling, 1 reply; 31+ messages in thread
From: Jon LaBadie @ 2002-07-10  0:14 UTC (permalink / raw)
  To: cygwin; +Cc: Thomas Baker

On Wed, Jul 10, 2002 at 05:40:39AM +0200, Thomas Baker wrote:
> 
> I also installed the ATT ksh -- there was a thread about this
> two or three weeks ago -- but understand that a KSH package
> for the standard Cygwin setup is on the way.  Have also had
> some small problems porting scripts, one of which being that
> "egrep" must always be changed to "grep -E".

Why?  Works fine for me.  But a hard link of egrep.exe
and grep.exe (and fgrep.exe) rather than symlink of
egrep -> grep.exe (no .exe) might help.

-- 
Jon H. LaBadie                  jcyg@jgcomp.com
 JG Computing
 4455 Province Line Road        (609) 252-0159
 Princeton, NJ  08540-4322      (609) 683-7220 (fax)

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: running mks toolkit and cygwin on same machine
  2002-07-09 21:59     ` Thomas Baker
  2002-07-09 22:09       ` Randall R Schulz
@ 2002-07-09 23:02       ` scowles
  2002-07-10  6:39         ` Thomas Baker
  2002-07-10  7:50         ` Charles Wilson
  2002-07-10  0:32       ` Jon LaBadie
  2 siblings, 2 replies; 31+ messages in thread
From: scowles @ 2002-07-09 23:02 UTC (permalink / raw)
  To: cygwin


Tuesday, July 9, 2002, 9:02:25 PM, you wrote:

TB> On Wed, Jul 10, 2002 at 05:40:39AM +0200, Thomas Baker wrote:

TB> Though Cygwin seems to have left MKS in the dust for most
TB> of the functions I am interested in -- vim vs. vi, mutt
TB> vs. mailx, fetchmail vs. something-that-didn't-work-for-me,
TB> procmail vs. nothing -- there are a few commands that I still
TB> use in their MKS versions:

TB>     cpio      - is this out of fashion now, or what?

yes, it is.  the big difference between cpio and tar in ages past was
that cpio could handle devices.  (arguably, complete lists in
configuration management are handled much easier by cpio's stdin
filename input method).  however, gnutar now handles devices just as well.
in addition, gnutar handles major compression techniques internally.
source for gnu cpio (i have used ver. 2.4.2 for years) is readily
available and compiles ootb on cygwin.  it handles all of my ancient
archives from multiple platforms.

TB>     flip      - changes CRLF endings; no equivalent in Cygwin?

easy to do in any shell:  invoke /bin/tr to do the translation
you need.  e.g.  for cr to lf:  cat $file | /bin/tr '\015' '\012'

[for those of you familiar with it, this invocation qualifies for
a Useless Use of cat award.
(http://www.ling.helsinki.fi/~reriksso/unix/award.html).  however,
it generalizes the technique for this example and easily allows for
rapid substitution of other i/o methods.]

TB>     more      - sometimes I do not want the text to disappear from
TB>                 the screen on exit

/bin/more is part of cygwin on my system (current as of 2 hours ago,
full install).

TB>     find/grep - the MKS versions can handle larger numbers of 
TB>                 arguments, though xargs solves the problem in Cygwin

qed.

TB>     rev       - reverse order of characters in a line

in zsh, the following works fine (credit to Bart Schaefer and Steve
Talley):

02-07-09
21:45:11 [551] host:./tmp% a="string"
02-07-09
21:46:08 [552] host:./tmp% eval a\=\( \"\$a\[{$#a..1}\]\" \)
02-07-09
21:46:12 [553] host:./tmp% echo $a
g n i r t s


scowles at earthlink dot net


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: running mks toolkit and cygwin on same machine
  2002-07-09 21:59     ` Thomas Baker
@ 2002-07-09 22:09       ` Randall R Schulz
  2002-07-10  6:35         ` Thomas Baker
  2002-07-09 23:02       ` scowles
  2002-07-10  0:32       ` Jon LaBadie
  2 siblings, 1 reply; 31+ messages in thread
From: Randall R Schulz @ 2002-07-09 22:09 UTC (permalink / raw)
  To: Thomas Baker, cygwin

Thomas,

- cpio
   Available, though little used, to my knowledge
- flip
   Use dos2unix and unix2dos
- more
   Available, as is "less" a superior alternative
- find / grep (arg list limits)
   All Unix / POSIX systems have argument list length limits,
   which is at least one reason why "xargs" exists.
- rev
   Unavailable, as far as I know

Randall Schulz
Mountain View, CA USA


At 21:02 2002-07-09, Thomas Baker wrote:
>On Wed, Jul 10, 2002 at 05:40:39AM +0200, Thomas Baker wrote:
> > I also installed the ATT ksh -- there was a thread about this
> > two or three weeks ago -- but understand that a KSH package
> > for the standard Cygwin setup is on the way.  Have also had
> > some small problems porting scripts, one of which being that
> > "egrep" must always be changed to "grep -E".
>
>Though Cygwin seems to have left MKS in the dust for most
>of the functions I am interested in -- vim vs. vi, mutt
>vs. mailx, fetchmail vs. something-that-didn't-work-for-me,
>procmail vs. nothing -- there are a few commands that I still
>use in their MKS versions:
>
>     cpio      - is this out of fashion now, or what?
>     flip      - changes CRLF endings; no equivalent in Cygwin?
>     more      - sometimes I do not want the text to disappear from
>                 the screen on exit
>     find/grep - the MKS versions can handle larger numbers of
>                 arguments, though xargs solves the problem in Cygwin
>     rev       - reverse order of characters in a line
>
>Tom


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: running mks toolkit and cygwin on same machine
  2002-07-09 21:49   ` Thomas Baker
@ 2002-07-09 21:59     ` Thomas Baker
  2002-07-09 22:09       ` Randall R Schulz
                         ` (2 more replies)
  2002-07-10  0:14     ` Jon LaBadie
  1 sibling, 3 replies; 31+ messages in thread
From: Thomas Baker @ 2002-07-09 21:59 UTC (permalink / raw)
  To: cygwin

On Wed, Jul 10, 2002 at 05:40:39AM +0200, Thomas Baker wrote:
> I also installed the ATT ksh -- there was a thread about this
> two or three weeks ago -- but understand that a KSH package
> for the standard Cygwin setup is on the way.  Have also had
> some small problems porting scripts, one of which being that
> "egrep" must always be changed to "grep -E".

Though Cygwin seems to have left MKS in the dust for most
of the functions I am interested in -- vim vs. vi, mutt
vs. mailx, fetchmail vs. something-that-didn't-work-for-me,
procmail vs. nothing -- there are a few commands that I still
use in their MKS versions:

    cpio      - is this out of fashion now, or what?
    flip      - changes CRLF endings; no equivalent in Cygwin?
    more      - sometimes I do not want the text to disappear from
                the screen on exit
    find/grep - the MKS versions can handle larger numbers of 
                arguments, though xargs solves the problem in Cygwin
    rev       - reverse order of characters in a line

Tom

-- 
Dr. Thomas Baker                                Thomas.Baker@bi.fhg.de
Institutszentrum Schloss Birlinghoven          mobile +49-171-408-5784
Fraunhofer-Gesellschaft                          work +49-30-8109-9027
53754 Sankt Augustin, Germany                    fax +49-2241-144-1408


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: running mks toolkit and cygwin on same machine
  2002-07-09 20:30 ` Paul Coltrin
@ 2002-07-09 21:49   ` Thomas Baker
  2002-07-09 21:59     ` Thomas Baker
  2002-07-10  0:14     ` Jon LaBadie
  2002-07-10  5:00   ` Jason Tishler
  1 sibling, 2 replies; 31+ messages in thread
From: Thomas Baker @ 2002-07-09 21:49 UTC (permalink / raw)
  To: cygwin

On Tue, Jul 09, 2002 at 05:35:09PM +0000, Paul Coltrin wrote:
> >From my limited experience, they seem to co-exist reasonably well.
> But it depends on what you need to do.  Unless it has changed very
> recently, the Cygwin installer does not contain a ksh.  I have
> downloaded and installed the ATT ksh into my Cygwin installation but
> I am finding that converting scripts from MKS ksh to Cygwin/ATT ksh
> is not trivial.

After installing Cygwin on a WIN2000 system with an existing
MKS installation, the two installations seemed to "lock horns".

I was able to establish peace by removing the MKS-related
environment variables from the system configuration (Start ->
Settings -> Control Panel -> System -> Advanced -> Environment
Variables) and moving them into profile.ksh.  Specifically:

	MKS_TK_PATH_BACK
	NUTCROOT
	ROOTDIR
	SHELL
	TERM (value had been "nutc")
	TERMCAP (value had been "E:\MKS\etc\termcap")
	TERMINFO (value had been "E:\MKS\usr\lib\terminfo")

In particular, the TERM* values seemed to be causing of alot
of the problems; Cygwin likes TERM=cygwin.

I also installed the ATT ksh -- there was a thread about this
two or three weeks ago -- but understand that a KSH package
for the standard Cygwin setup is on the way.  Have also had
some small problems porting scripts, one of which being that
"egrep" must always be changed to "grep -E".

Tom

-- 
Dr. Thomas Baker                                Thomas.Baker@bi.fhg.de
Institutszentrum Schloss Birlinghoven          mobile +49-171-408-5784
Fraunhofer-Gesellschaft                          work +49-30-8109-9027
53754 Sankt Augustin, Germany                    fax +49-2241-144-1408

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: running mks toolkit and cygwin on same machine
  2002-07-09  9:02 Scott Dudley
@ 2002-07-09 20:30 ` Paul Coltrin
  2002-07-09 21:49   ` Thomas Baker
  2002-07-10  5:00   ` Jason Tishler
  0 siblings, 2 replies; 31+ messages in thread
From: Paul Coltrin @ 2002-07-09 20:30 UTC (permalink / raw)
  To: cygwin

Scott,

From my limited experience, they seem to co-exist reasonably well.
But it depends on what you need to do.  Unless it has changed very
recently, the Cygwin installer does not contain a ksh.  I have
downloaded and installed the ATT ksh into my Cygwin installation but
I am finding that converting scripts from MKS ksh to Cygwin/ATT ksh
is not trivial.

Paul Coltrin


At 08:52 AM 7/9/02 -0700, Scott Dudley wrote:
>
>does anyone have experiences with running mks toolkit and cygwin on the 
>same machine?  my company's customers run mks but i'd very much like to 
>attempt a cygwin test on one of these systems.
>
>many thanks.
>
>-- 
>
>Regards,
>
>Scott Dudley
>
>SPAMMERSNEEDNTBOTHER
>
>
>
>--
>Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>Bug reporting:         http://cygwin.com/bugs.html
>Documentation:         http://cygwin.com/docs.html
>FAQ:                   http://cygwin.com/faq/
>



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* running mks toolkit and cygwin on same machine
@ 2002-07-09  9:02 Scott Dudley
  2002-07-09 20:30 ` Paul Coltrin
  0 siblings, 1 reply; 31+ messages in thread
From: Scott Dudley @ 2002-07-09  9:02 UTC (permalink / raw)
  To: cygwin


does anyone have experiences with running mks toolkit and cygwin on the 
same machine?  my company's customers run mks but i'd very much like to 
attempt a cygwin test on one of these systems.

many thanks.

-- 

Regards,

Scott Dudley

SPAMMERSNEEDNTBOTHER



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2002-07-11  3:07 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-09 22:12 running mks toolkit and cygwin on same machine Robert Collins
2002-07-09 22:14 ` Christopher Faylor
2002-07-09 23:22   ` Robert Collins
2002-07-10  8:13   ` Charles Wilson
2002-07-10  8:19     ` Charles Wilson
2002-07-10  8:37     ` Conrad Scott
2002-07-10  9:19       ` Charles Wilson
2002-07-10  9:26         ` Conrad Scott
2002-07-10  9:28 ` Nicholas Wourms
  -- strict thread matches above, loose matches on Subject: below --
2002-07-10  4:48 John Vincent
2002-07-10  8:26 ` Charles Wilson
2002-07-10  8:36   ` Charles Wilson
2002-07-09  9:02 Scott Dudley
2002-07-09 20:30 ` Paul Coltrin
2002-07-09 21:49   ` Thomas Baker
2002-07-09 21:59     ` Thomas Baker
2002-07-09 22:09       ` Randall R Schulz
2002-07-10  6:35         ` Thomas Baker
2002-07-10  6:49           ` David Starks-Browning
2002-07-10  7:49             ` Thomas Baker
2002-07-09 23:02       ` scowles
2002-07-10  6:39         ` Thomas Baker
2002-07-10  8:00           ` Charles Wilson
2002-07-10 22:47           ` scowles
2002-07-10  7:50         ` Charles Wilson
2002-07-10  0:32       ` Jon LaBadie
2002-07-10  8:26         ` Charles Wilson
2002-07-10  0:14     ` Jon LaBadie
2002-07-10  6:48       ` Thomas Baker
2002-07-10  7:26         ` Randall R Schulz
2002-07-10  5:00   ` Jason Tishler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).