From: Eric Hodel Date: 2002-12-11T09:29:17+09:00 Subject: Re: Ruby Question --xs+9IvWevLaxKUtW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable George (geoflorida2000@yahoo.com) wrote: > I want to write command line Ruby program whose arguments will be a=20 > list of words to be found within all HTML documents of the current=20 > directory. The output of the program will be a text file called=20 > results.txt and will consist of a list of all HTML documents in which=20 > one of the words appeared. Have the program create a subdirectory=20 > called FINAL ,of the current directory and save results.txt there.=20 > Finally, it will make duplicate copies of each of the files listed in=20 > results.txt within the FINAL directory. > Any help would be greatly appreciated > George system(%q!sh "list=3D'word1 word2 ...'; mkdir -p FINAL; for a in list; do f= or f in *.html; do grep $a $f >/dev/null && echo $f >> FINAL/results.txt &&= cp $f FINAL; done; done"!) I think --=20 Eric Hodel - drbrain@segment7.net - http://segment7.net All messages signed with fingerprint: FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04 --xs+9IvWevLaxKUtW Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.0 (FreeBSD) iD8DBQE99obaMypVHHlsnwQRAlZsAKDQ9wnbLTUksoMKA0Bj1JRkXKXivACcD636 UeV8bXTCAjkdC4Hbfi7gUfM= =R3On -----END PGP SIGNATURE----- --xs+9IvWevLaxKUtW--