0

I'd like to download a different version of grep in Cygwin. Currently, I have version 2.21, but I'd like to get version 2.5.1 (this is what runs on Mac OS by default, and I'm more familiar with that).

I obviously don't want to run the entire setup again. Is there a way to get the Mac OS version (i.e. 2.5.1) without running setup all over again? Thanks. <3

makansij
  • 9,303
  • 37
  • 105
  • 183
  • I think you *do* just run the setup again. It keeps track of what you've already installed and will show you a list. I think you click on the version number to cycle it through versions. Then click "install" (or whatever). – ooga Jun 25 '15 at 20:45
  • It doesn't look like cygwin has anything above 2.21 available. It has 2.21-1 and 2.21-2. (Look under Base.) – ooga Jun 25 '15 at 20:53
  • You can *always* compile your own version (`grep` does not have many dependencies, and the exercise is educational). – Thomas Dickey Jun 25 '15 at 22:37

1 Answers1

1

Compiling is always a possible choice: grep lives here: ftp://ftp.gnu.org/gnu/grep/, and given the tarball (ftp://ftp.gnu.org/gnu/grep/grep-2.5.1.tar.gz),

tar xf 2.5.1.tar.gz
cd 2.5.1
./configure
make && make install

(this will probably install into /usr/local/bin — you should read the instructions, e.g., the --prefix option to suit your own needs).

That assumes you are developing, and have installed gcc (the Cygwin setup program helps in that case).

Thomas Dickey
  • 51,086
  • 7
  • 70
  • 105