"C:\Program Files\GnuWin32\bin\find" . -name "filename.txt" -exec "C:\Program Files\GnuWin32\bin\grep" -H Keyword {} ;
Showing posts with label GNU. Show all posts
Showing posts with label GNU. Show all posts
Thursday, February 21, 2013
Using gnuwin32 find and grep
My issue is that I've just been too lazy to set up my $PATH correctly on my windows system, so I have to call out the full executable path thusly:
Sunday, February 5, 2012
tar for windows, windows cannot fork
So, I wanted to duplicate my trick of using os.system calls in python to tar, gzip, and delete some files on my Windows filesystem. Leaving aside how completely ignorant this idea was since both things can be done from within python and platform independently, the story of the problem that I encountered and its solution is worth remembering.
Since I totally use the "GNU for windows" utilities to do things in windows when I don't want to step into Cygwin, I just downloaded GNUWin tar and tried it out:
http://gnuwin32.sourceforge.net/packages/gtar.htm
http://gnuwin32.sourceforge.net/packages/gzip.htm
http://gnuwin32.sourceforge.net/packages/coreutils.htm
However, when I blithely fed my first tar command into it using the gzip option and wildcards, I got an error "Windows cannot fork". So sad. It turns out that it looks like the GNU tar port can't call gzip to do the -z option or something?
http://osdir.com/ml/lang.ruby.rake/2006-11/msg00014.html
http://www.worthinstalling.com/2006/06/command-line-compression-for-windows.html
http://stackoverflow.com/questions/1437875/tar-on-windows-a-list-of-files-in-c-sharp
As indicated in the first two links above, the answer is to use bsdtar, which is just a different GNU utility that's compatible with everybody else in my GNU installation folder and installs exactly the same way but with a different picture in the install window:
http://gnuwin32.sourceforge.net/packages/libarchive.htm
Beautiful.
Since I totally use the "GNU for windows" utilities to do things in windows when I don't want to step into Cygwin, I just downloaded GNUWin tar and tried it out:
http://gnuwin32.sourceforge.net/packages/gtar.htm
http://gnuwin32.sourceforge.net/packages/gzip.htm
http://gnuwin32.sourceforge.net/packages/coreutils.htm
However, when I blithely fed my first tar command into it using the gzip option and wildcards, I got an error "Windows cannot fork". So sad. It turns out that it looks like the GNU tar port can't call gzip to do the -z option or something?
http://osdir.com/ml/lang.ruby.rake/2006-11/msg00014.html
http://www.worthinstalling.com/2006/06/command-line-compression-for-windows.html
http://stackoverflow.com/questions/1437875/tar-on-windows-a-list-of-files-in-c-sharp
As indicated in the first two links above, the answer is to use bsdtar, which is just a different GNU utility that's compatible with everybody else in my GNU installation folder and installs exactly the same way but with a different picture in the install window:
http://gnuwin32.sourceforge.net/packages/libarchive.htm
Beautiful.
Subscribe to:
Posts (Atom)