Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

I am making progress but code not running exactly right yet...

by Kevin_Raymer
on Feb 14, 2007 at 13:56 UTC ( #599940=perlquestion: print w/ replies, xml ) Need Help??
Kevin_Raymer has asked for the wisdom of the Perl Monks concerning the following question:

I am supposed to be seeing a backup report yet I am getting all this screen noise.......

Here is my code that I hacked..
#!/usr/bin/perl bpstart_notify.loc1_server1_nt.bat @REM this script is called by NetBackup when a backup is initiated @REM this script: @REM receives 4 parameters, clientname, classname, schedname and sc +hedtype @REM must be executable by a user with Administrator rights @REM should exit with 0 upon successful completion @REM @REM If this script will not complete within a few seconds, you should + set @REM the BPSTART_TIMEOUT in the NetBackup configuration gui on the ser +ver. @REM You should also be aware that the time taken by this script will +delay @REM the initiation of other client's backups. @REM @REM - This script only runs on NT 4.0 and succeeding versions of NT. + You must @REM - have command extensions enabled. Check the following registry +entry: @REM - HKEY_CURRENT_USER\Software\Microsoft\Command Processor\EnableEx +tensions @REM - @REM - It should be set to 0x1 or you may have problems running this s +cript. @setlocal ENABLEEXTENSIONS @set LISTPATHS="%~dp0\goodies\listpaths" @for /F "delims=|" %%p in ('%LISTPATHS% /s NB_MAIL_SCRIPT') do @set NB +_MAIL_SCRIPT="%%p" @set OUTF="d:\srvapps\veritas\backupresults\bpstart_notify.loc1_server +1_nt.txt" @REM - Get date and time. @REM @for /F "tokens=1*" %%p in ('date /T') do @set DATE=%%p %%q @for /F %%p in ('time /T') do @set DATE=%DATE% %%p @REM @echo "This is a start_notify script" > %OUTF% @REM @REM Unremark the following line and add you batch file, command file + etc. net stop "nai epolicy orchestrator agent" >> %OUTF% net stop "network associates mcshield" >> %OUTF% net stop "network associates alert manager" >> %OUTF% ~

Here is the screen noise...

[root@houic-u-s00001 /]# ./nb.pl Array found where operator expected at ./nb.pl line 4, at end of line (Missing semicolon on previous line?) syntax error at ./nb.pl line 4, near "bat @REM " Bareword found where operator expected at ./nb.pl line 4, near "@REM t +his" (Missing operator before this?) Array found where operator expected at ./nb.pl line 5, at end of line (Missing semicolon on previous line?) Bareword found where operator expected at ./nb.pl line 5, near "@REM t +his" (Missing operator before this?) Bareword found where operator expected at ./nb.pl line 6, near "@REM + receives" (Missing operator before receives?) Number found where operator expected at ./nb.pl line 6, near "receives + 4" (Do you need to predeclare receives?) Bareword found where operator expected at ./nb.pl line 6, near "4 para +meters" (Missing operator before parameters?) Array found where operator expected at ./nb.pl line 7, at end of line (Missing semicolon on previous line?) Bareword found where operator expected at ./nb.pl line 7, near "@REM + must" (Missing operator before must?) Array found where operator expected at ./nb.pl line 8, at end of line (Missing semicolon on previous line?) Bareword found where operator expected at ./nb.pl line 8, near "@REM + should" (Missing operator before should?) Number found where operator expected at ./nb.pl line 8, near "with 0" (Do you need to predeclare with?) Bareword found where operator expected at ./nb.pl line 8, near "0 upon +" (Missing operator before upon?) Array found where operator expected at ./nb.pl line 9, at end of line (Missing semicolon on previous line?) Array found where operator expected at ./nb.pl line 10, at end of line (Missing semicolon on previous line?) Bareword found where operator expected at ./nb.pl line 10, near "@REM +If" (Missing operator before If?) Array found where operator expected at ./nb.pl line 11, at end of line (Missing semicolon on previous line?) Bareword found where operator expected at ./nb.pl line 11, near "@REM +the" (Missing operator before the?) Bareword found where operator expected at ./nb.pl line 12, near "@REM +You" (Missing operator before You?) Bareword found where operator expected at ./nb.pl line 12, near "time +taken" (Do you need to predeclare time?) Bareword found where operator expected at ./nb.pl line 13, near "@REM +the" (Missing operator before the?) Array found where operator expected at ./nb.pl line 15, at end of line (Missing semicolon on previous line?) Backslash found where operator expected at ./nb.pl line 17, near "HKEY +_CURRENT_USER\" Backslash found where operator expected at ./nb.pl line 17, near "Soft +ware\" Backslash found where operator expected at ./nb.pl line 17, near "Micr +osoft\" Array found where operator expected at ./nb.pl line 18, at end of line (Missing semicolon on previous line?) Number found where operator expected at ./nb.pl line 19, near "to 0x1" (Do you need to predeclare to?) Bareword found where operator expected at ./nb.pl line 20, near "@setl +ocal ENABLEEXTENSIONS" (Missing operator before ENABLEEXTENSIONS?) Array found where operator expected at ./nb.pl line 21, at end of line (Missing semicolon on previous line?) Bareword found where operator expected at ./nb.pl line 21, near "@set +LISTPATHS" (Missing operator before LISTPATHS?) Array found where operator expected at ./nb.pl line 22, at end of line (Missing semicolon on previous line?) String found where operator expected at ./nb.pl line 22, near "F "deli +ms=|"" (Do you need to predeclare F?) Bareword found where operator expected at ./nb.pl line 22, near "%p in +" (Missing operator before in?) Bareword found where operator expected at ./nb.pl line 22, near "@set +NB_MAIL_SCRIPT" (Missing operator before NB_MAIL_SCRIPT?) Array found where operator expected at ./nb.pl line 23, at end of line (Missing semicolon on previous line?) Bareword found where operator expected at ./nb.pl line 23, near "@set +OUTF" (Missing operator before OUTF?) Array found where operator expected at ./nb.pl line 24, at end of line (Missing semicolon on previous line?) Array found where operator expected at ./nb.pl line 26, at end of line (Missing semicolon on previous line?) String found where operator expected at ./nb.pl line 26, near "F "toke +ns=1*"" (Do you need to predeclare F?) Bareword found where operator expected at ./nb.pl line 26, near "%p in +" (Missing operator before in?) Bareword found where operator expected at ./nb.pl line 26, near "@set +DATE" (Missing operator before DATE?) Bareword found where operator expected at ./nb.pl line 26, near "%%p" (Missing operator before p?) Operator or semicolon missing before %p at ./nb.pl line 26. Ambiguous use of % resolved as operator % at ./nb.pl line 26. Array found where operator expected at ./nb.pl line 27, at end of line (Missing semicolon on previous line?) Bareword found where operator expected at ./nb.pl line 27, near "%p in +" (Missing operator before in?) Bareword found where operator expected at ./nb.pl line 27, near "@set +DATE" (Missing operator before DATE?) Bareword found where operator expected at ./nb.pl line 27, near "%%p" (Missing operator before p?) Operator or semicolon missing before %p at ./nb.pl line 28. Ambiguous use of % resolved as operator % at ./nb.pl line 28. Array found where operator expected at ./nb.pl line 28, at end of line (Missing semicolon on previous line?) Array found where operator expected at ./nb.pl line 29, at end of line (Missing semicolon on previous line?) String found where operator expected at ./nb.pl line 29, near "@echo " +This is a start_notify script"" (Missing operator before "This is a start_notify script"?) Array found where operator expected at ./nb.pl line 31, at end of line (Missing semicolon on previous line?) Bareword found where operator expected at ./nb.pl line 31, near "@REM + Unremark" (Missing operator before Unremark?) Execution of ./nb.pl aborted due to compilation errors.

I have 22 years experience and have never seen anything like this! I am beginning to wonder if PERL even works!

KR

2007-02-19 Considered by andye: troll
2007-02-28 Unconsidered by Arunbear: enough keep (and edit) votes {Keep: 16, Edit: 2, Reap: 22}

Comment on I am making progress but code not running exactly right yet...
Select or Download Code
Re: I am making progress but code not running exactly right yet...
by japhy (Canon) on Feb 14, 2007 at 14:03 UTC
    Update: ugh, perhaps I should have looked at the history behind this post. Sorry.

    Here's a hint. That's not Perl. That's an MS-DOS BATCH file. I really don't know what else to say.


    Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
    How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart
Re: I am making progress but code not running exactly right yet...
by Fletch (Chancellor) on Feb 14, 2007 at 14:04 UTC

    Erm, you're feeding a DOS-esque batch script through the Perl interpreter and your "22 years of experience" leads you to think that that should work?

    /boggle

Re: I am making progress but code not running exactly right yet...
by johngg (Abbot) on Feb 14, 2007 at 14:11 UTC
    @REM - This script only runs on NT 4.0 and succeeding versions of NT

    What didn't you understand about that comment? If it's not rude to ask, 22 years experience of what, exactly?

    Cheers,

    JohnGG

Re: I am making progress but code not running exactly right yet...
by chakram88 (Pilgrim) on Feb 14, 2007 at 14:12 UTC
    Perl works just fine. This is PEBCAK.
Re: I am making progress but code not running exactly right yet...
by lin0 (Curate) on Feb 14, 2007 at 14:23 UTC

    Dear Kevin,

    Welcome to reality! It does not matter that you are 22 years old (or did you say you have 22 years of experience?) if you do not read the manual... You should go step by step. Yesterday, I told you to check the Tutorials. In particular, you should read:

    Once you finish reading those nodes, I recommend you to get an Introductory Perl Book and start learning.

    And, please, be nice when asking for something. Remember that we, all here, are volunteering our time to get the most out of this community. To help you get better at asking, I recommend you to read all the nodes mentioned in Understanding and Using PerlMonks

    Again, welcome to the Monastery. I am sure your journey learning Perl will be an enlightening one!

    Cheers,

    lin0
Re: I am making progress but code not running exactly right yet...
by shmem (Canon) on Feb 14, 2007 at 14:26 UTC
    I am beginning to wonder if PERL even works!

    Well, had you read the manual... the pain starts with the blank second line. Don't do that! Fill that gap, here's how. Insert the following below the first line

    open O, "| command.com"; print O while <DATA>; __DATA__
    and the noise will go away (on windows, that is).

    --shmem

    _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                  /\_¯/(q    /
    ----------------------------  \__(m.====·.(_("always off the crowd"))."·
    ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

      From the comments it's clear that the code is meant to run under NT 4, so your suggestion is an excellent one shmem. Perhaps you could submit that as a new module on CPAN called dos2perl?

      Kevin, you should also add:

      use strict; use warnings;
Re: I am making progress but code not running exactly right yet...
by Herkum (Parson) on Feb 14, 2007 at 14:27 UTC
    I recognize this sort of error. It falls into the category of user does not know what they are doing. or user is a troll. This node needs to be reaped.
Re: I am making progress but code not running exactly right yet...
by blue_cowdawg (Monsignor) on Feb 14, 2007 at 14:38 UTC
        I have 22 years experience and have never seen anything like this!

    ahem! Are you sure you have 22 years of experience and not 1 year of experience 22 times?

        I am beginning to wonder if PERL even works!

    And I have one word for you: syntax and I am going to say something I very rarely say: RTFM

    Other monks in this thread have pointed the way to some excellent resources for you to read and potentially learn from.


    Peter L. Berghold -- Unix Professional
    Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg
Re: I am making progress but code not running exactly right yet...
by derby (Abbot) on Feb 14, 2007 at 14:58 UTC

    ooOO ... ACME::MJD - #11901 - You can't just make shit up and expect the computer to know what you mean, Retardo!

    -derby
Re: I am making progress but code not running exactly right yet...
by bluto (Curate) on Feb 14, 2007 at 16:33 UTC
    I'm almost tempted to give you a ++ here since watching people flail around trying to respond to pure gibberish is amusing in a strange sort of way, but you are probably hoping for a -- instead. Even though your disguise is wearing kind of thin, I must admit I'm always amazed by the amount of people that have passionate remarks about these kinds of posts.

    Monks, it doesn't take much to look back a few posts and see that this is an obvious troll. If you feed him, you better give him just cotton candy.

Re: I am making progress but code not running exactly right yet...
by ikegami (Pope) on Feb 14, 2007 at 16:37 UTC

    What progress? There's no Perl in there.

    Here is the screen noise...

    Noise, is it? If it's noise, ignore it. If it's not, then call it what it really is.

Re: I am making progress but code not running exactly right yet...
by robot_tourist (Hermit) on Feb 14, 2007 at 16:41 UTC

    At the present time this is mildly amusing, but, Kevin, please don't end up like the 'I didn't do it kid' who only had one lame joke.

    What Kevin_Raymer really needs is one of TheDamian's ACME modules, like bleach or JAPH, but preferably Buffy.

    Monks, I hope you aren't taking this guy seriously. Do not spend your time linking to the many excellent help facilities available. This is an obvious joke.

    How can you feel when you're made of steel? I am made of steel. I am the Robot Tourist.
    Robot Tourist, by Ten Benson

Re: I am making progress but code not running exactly right yet...
by swampyankee (Parson) on Feb 14, 2007 at 17:03 UTC

    Perl works. I am, however, surprised that you do.

    Since I'm not currently employed (rifted), I have some time for this nonsense. I suggest you repeat these mantras:

    • Perl is not DOS. DOS is a (primitive) operating system.
    • Perl (not PERL) is a language.
    • Solaris is not DOS. Solaris is a very robust operating system.
    • BAT files are specific to DOS.

    Now, answer this question: given this code: saxpy would you expect it to compile under VB? If not, why do you expect BAT files to be interpreted by a completely different operating system?

    emc

    Insisting on perfect safety is for people who don't have the balls to live in the real world.

    —Mary Shafer, NASA Dryden Flight Research Center
Re: I am making progress but code not running exactly right yet...
by imp (Priest) on Feb 14, 2007 at 17:14 UTC
      The quality of the average post in PM is quite high, I think, compared to the average post in the average forum out there, which may be partly why some newcomers may be having difficulty adjusting their tone. I have developed great respect for the patience and positive attitude of many wise Monks.
Re: I am making progress but code not running exactly right yet...
by xorl (Deacon) on Feb 14, 2007 at 18:45 UTC

    First I don't see use strict anywhere.

    Second the error messages are quite descriptive.

    Third what is your IQ? If you're not being stupid on purpose, I'm shocked you even learned to read and write English.

    Fourth it is time to tell your boss that you need help. Others have mentioned good online resources and books. I'd suggest you check with your local community college to see if they have a perl class. There are also a number of places that have weekend perl seminars. Google is your friend perl seminar perl training

Re: I am making progress but code not running exactly right yet...
by Anonymous Monk on Feb 15, 2007 at 15:13 UTC
    Kevin,

    I am sorry for your treatment on this site. Your problem is you are using the wrong DOS. Perl DOS is not compatible with backup reports as it creates a lot of noise.

    The solution is Python DOS. See Python.com and I am sure their users at the news://comp.lang.python newsgroup will be more helpful than us.

    Your friend Anon

        Oops!! Well, at least he can DOS around there instead ;)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://599940]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (11)
As of 2014-12-22 12:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (116 votes), past polls