find2perl question(s) from a newbie

Howdie all!

From what I have read, find2perl takes one's "(Unix) find" commands inputs and translates it into a perl find script.

Theoretically, at least as described, one is able to modify/customize the resultant script.

OK, my dilemma here. I'm on a Windows platform using a DOS prompt window. I enter the appropriate command, i.e.,

find2perl . -name *logs -print

find2perl produces what appears to be a potentially usable script, but doesn't store the results, but rather displayed it in
the DOS prompt ... so ... I next issue the following command

find2perl . -name *logs -print > logsfind.pl

Again find2perl produces a script output that is displayed, and the file name logsfind.pl is created, but has nothing written to
it. It has 0 bytes. Nada! Zilch!

I can't cut and paste the produced script from the DOS prompt (Is there a way? Win 98SE OS) so I can modify it for potential
usage.

I'm missing something somewhere. I guess first I'm asking 1. Do I understand the basic functionality of find2perl correctly, i.e.,
that it produces a similar Unix find script in a usable Perl format? 2. Does the syntax to my issued commands look correct for what
I am attempting to do?

Any and all comments and suggestions welcomed. Thanks in advance.

Comments

  • : Howdie all!
    :
    : From what I have read, find2perl takes one's "(Unix) find" commands inputs and translates it into a perl find script.
    :
    : Theoretically, at least as described, one is able to modify/customize the resultant script.
    :
    : OK, my dilemma here. I'm on a Windows platform using a DOS prompt window. I enter the appropriate command, i.e.,
    :
    : find2perl . -name *logs -print
    :
    : find2perl produces what appears to be a potentially usable script, but doesn't store the results, but rather displayed it in
    : the DOS prompt ... so ... I next issue the following command
    :
    : find2perl . -name *logs -print > logsfind.pl
    :
    : Again find2perl produces a script output that is displayed, and the file name logsfind.pl is created, but has nothing written to
    : it. It has 0 bytes. Nada! Zilch!
    :
    : I can't cut and paste the produced script from the DOS prompt (Is there a way? Win 98SE OS) so I can modify it for potential
    : usage.
    :
    : I'm missing something somewhere. I guess first I'm asking 1. Do I understand the basic functionality of find2perl correctly, i.e.,
    : that it produces a similar Unix find script in a usable Perl format? 2. Does the syntax to my issued commands look correct for what
    : I am attempting to do?
    :
    : Any and all comments and suggestions welcomed. Thanks in advance.
    :

    Hi there,

    I'm running WinXP and from the console, piping the output to logsfind.pl worked.

    Try this code...

    [code]

    open (X, "find2perl . -name *logs -print |");
    open (Y, "> logsfind.pl");

    while () {
    print Y;
    }

    close (Y);
    close (X);

    [/code]

    This SHOULD read whatever is output'ed from find2perl and dump it to logsfind.pl for you.

    As for the syntax, sorry but I can't help you there.

    Cya
    Bradley q:)
  • : : Howdie all!
    : :
    : : From what I have read, find2perl takes one's "(Unix) find" commands inputs and translates it into a perl find script.
    : :
    : : Theoretically, at least as described, one is able to modify/customize the resultant script.
    : :
    : : OK, my dilemma here. I'm on a Windows platform using a DOS prompt window. I enter the appropriate command, i.e.,
    : :
    : : find2perl . -name *logs -print
    : :
    : : find2perl produces what appears to be a potentially usable script, but doesn't store the results, but rather displayed it in
    : : the DOS prompt ... so ... I next issue the following command
    : :
    : : find2perl . -name *logs -print > logsfind.pl
    : :
    : : Again find2perl produces a script output that is displayed, and the file name logsfind.pl is created, but has nothing written to
    : : it. It has 0 bytes. Nada! Zilch!
    : :
    : : I can't cut and paste the produced script from the DOS prompt (Is there a way? Win 98SE OS) so I can modify it for potential
    : : usage.
    : :
    : : I'm missing something somewhere. I guess first I'm asking 1. Do I understand the basic functionality of find2perl correctly, i.e.,
    : : that it produces a similar Unix find script in a usable Perl format? 2. Does the syntax to my issued commands look correct for what
    : : I am attempting to do?
    : :
    : : Any and all comments and suggestions welcomed. Thanks in advance.
    : :
    :
    : Hi there,
    :
    : I'm running WinXP and from the console, piping the output to logsfind.pl worked.
    :
    : Try this code...
    :
    : [code]
    :
    : open (X, "find2perl . -name *logs -print |");
    : open (Y, "> logsfind.pl");
    :
    : while () {
    : print Y;
    : }
    :
    : close (Y);
    : close (X);
    :
    : [/code]
    :
    : This SHOULD read whatever is output'ed from find2perl and dump it to logsfind.pl for you.
    :
    : As for the syntax, sorry but I can't help you there.
    :
    : Cya
    : Bradley q:)
    :

    Hey Bradley (if I may)!

    Thanks. Your suggested code worked without a hitch.

    I'm still a bit complexed here though because essentially I took your code and created an executable
    script, logfinder.pl. I then entered "perl -w logfinder.pl" in the DOS prompt window and hit .
    The script executed and produced the desired output file, logsfind.pl, with the find2perl generated output
    using the original parameters I had provided. So very good from that perspective ... progress made and
    I now understand I can take that approach, i.e., create a script to create a script that I desire. But, maybe
    because of my little Unix background, I somehow feel (probably wrongly) that my original approach should
    have worked. Oh well, as I said, I made some progress in understanding from your suggested approach.
    I appreciate your inputs! Hope someday that I may be able to reciprocate.

  • : : Howdie all!
    : :
    : : From what I have read, find2perl takes one's "(Unix) find" commands inputs and translates it into a perl find script.
    : :
    : : Theoretically, at least as described, one is able to modify/customize the resultant script.
    : :
    : : OK, my dilemma here. I'm on a Windows platform using a DOS prompt window. I enter the appropriate command, i.e.,
    : :
    : : find2perl . -name *logs -print
    : :
    : : find2perl produces what appears to be a potentially usable script, but doesn't store the results, but rather displayed it in
    : : the DOS prompt ... so ... I next issue the following command
    : :
    : : find2perl . -name *logs -print > logsfind.pl
    : :
    : : Again find2perl produces a script output that is displayed, and the file name logsfind.pl is created, but has nothing written to
    : : it. It has 0 bytes. Nada! Zilch!
    : :
    : : I can't cut and paste the produced script from the DOS prompt (Is there a way? Win 98SE OS) so I can modify it for potential
    : : usage.
    : :
    : : I'm missing something somewhere. I guess first I'm asking 1. Do I understand the basic functionality of find2perl correctly, i.e.,
    : : that it produces a similar Unix find script in a usable Perl format? 2. Does the syntax to my issued commands look correct for what
    : : I am attempting to do?
    : :
    : : Any and all comments and suggestions welcomed. Thanks in advance.
    : :
    :
    : Hi there,
    :
    : I'm running WinXP and from the console, piping the output to logsfind.pl worked.
    :
    : Try this code...
    :
    : [code]
    :
    : open (X, "find2perl . -name *logs -print |");
    : open (Y, "> logsfind.pl");
    :
    : while () {
    : print Y;
    : }
    :
    : close (Y);
    : close (X);
    :
    : [/code]
    :
    : This SHOULD read whatever is output'ed from find2perl and dump it to logsfind.pl for you.
    :
    : As for the syntax, sorry but I can't help you there.
    :
    : Cya
    : Bradley q:)
    :

    Hey Bradley (if I may)!

    Thanks. Your suggested code worked without a hitch.

    I'm still a bit complexed here though because essentially I took your code and created an executable
    script, logfinder.pl. I then entered "perl -w logfinder.pl" in the DOS prompt window and hit .
    The script executed and produced the desired output file, logsfind.pl, with the find2perl generated output
    using the original parameters I had provided. So very good from that perspective ... progress made and
    I now understand I can take that approach, i.e., create a script to create a script that I desire. But, maybe
    because of my little Unix background, I somehow feel (probably wrongly) that my original approach should
    have worked. Oh well, as I said, I made some progress in understanding from your suggested approach.
    I appreciate your inputs! Hope someday that I may be able to reciprocate.

  • : Hey Bradley (if I may)!
    :
    *grin*

    : Thanks. Your suggested code worked without a hitch.
    :
    No worries.

    : I'm still a bit complexed here though because essentially I took your code and created an executable
    : script, logfinder.pl. I then entered "perl -w logfinder.pl" in the DOS prompt window and hit .
    : The script executed and produced the desired output file, logsfind.pl, with the find2perl generated output
    : using the original parameters I had provided. So very good from that perspective ... progress made and
    : I now understand I can take that approach, i.e., create a script to create a script that I desire. But, maybe
    : because of my little Unix background, I somehow feel (probably wrongly) that my original approach should
    : have worked. Oh well, as I said, I made some progress in understanding from your suggested approach.
    : I appreciate your inputs! Hope someday that I may be able to reciprocate.
    :
    :
    In actuality, it SHOULD have worked due to the fact that Win98 does know how to redirect output but doesn't do it very well.

    The later versions of Windows have corrected this bug and you ARE able to do exactly what you originally done.

    You Unix experience is exactly what Microsoft have only now succeded in implementing within their Partially Operating System.

    Cya
    Bradley q:)
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories