tclGrep

  • Creator
    Topic
  • #55150
    Charlie Bursell
    Participant

      As I said I have been pretty bored lately so i wrote a new script, tclGrep.  Actually it is a replacement for the script, perl_grep, which I wrote many years ago and should now be in your contrib directory.

      tclGrep will do all that perl_grep does and much more.  Run tclGrep -h to see usage.  Also read the script comments.

      It should work as well on Unix.  Just remove the .htc suffix and make sure it is executable.   You may have to remove carriage returns from the script like:

                   perl -pi -e “s/r//g” tclGrep

      I would put it in the contrib directory whether Windows or Unix.

      I hope you find it usefull.  Let me know how many bugs you find  ðŸ˜†

    Viewing 1 reply thread
    • Author
      Replies
      • #84343
        David Barr
        Participant

          It looks like if you run this on unix and you want to search multiple files with a wildcard, you have to make sure that the wildcard is not interpreted by the shell. This is different than standard grep. So an example command would be:

          Code:

          ./tclGrep -p mypattern -f ‘myfiles*.txt’

        • #84344
          Charlie Bursell
          Participant

            Thanks for pointing this out Dave.  It has been my experience with Tcl command line arguments whether on Unix or Windows you must quote any glob characters so they are not interpreted by the shell, single quotes for Unix and double quotes for Windows.  The same is true if you pass a regular expression that contains meta characters.

            I appreciate you trying it.  As I said I do not have access to a Unix box.

        Viewing 1 reply thread
        • The forum ‘Tcl Library’ is closed to new topics and replies.