Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

invoking perl scripts....

by Anonymous Monk
on May 01, 2002 at 16:46 UTC ( [id://163299]=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I have a very basic question... and this maybe because I'm not a Unix expert. I've the perl script in a path like '/usr/interfaces/scripts/' and am trying to invoke the script from a scheduler with the absolute command as '/usr/interfaces/scripts/perl ccs_rename.pl <parameter>' but it gives me an error saying '/usr/interfaces/scripts/perl: not found'. Is there a nother way that I should be invoking this ? Thanks!

Replies are listed 'Best First'.
Re: invoking perl scripts....
by Mr. Muskrat (Canon) on May 01, 2002 at 17:05 UTC

    Do you have the shebang line at the top of your script?
    What's a shebang line you ask? It's how the shell knows what interpreter to use to run the script. It's a #! followed by the path to perl. #!/usr/bin/perl

    Try /usr/interfaces/scripts/ccs_rename.pl instead.
    And that failing then /usr/bin/perl /usr/interfaces/scripts/ccs_rename.pl


    Matthew Musgrove
    Who says that programmers can't work in the Marketing Department?
    Or is that who says that Marketing people can't program?
      This sounds like your problem to me, too. I would only add to carefully check that shebang line. I can't tell you how many times I've typed: !#/usr/bin/perl -wor#!/usr/bin/prel -wor#!/bin/usr/perl -w One quick way tell if this isn't the problem is if you can invoke the script from the command line.

      Let us know if you still have problems.

      Pepik

      PS /usr/bin/perl should be replaced with whatever comes up when you type which perlat the command line.

      Here's what I get:

      $ which perl /usr/bin/perl
Re: invoking perl scripts....
by meraxes (Friar) on May 01, 2002 at 17:01 UTC

    You're trying to run a non existent perl binary. Put the path with the script:

    perl /usr/interfaces/scripts/ccs_rename.pl

    L8r
    meraxes

Re: invoking perl scripts....
by atopolc (Pilgrim) on May 01, 2002 at 18:48 UTC

    Your scheduler may not allow you to run a perl script with the directive in front,  perl /usr/interfaces/scripts/ccs_rename.pl.My scheduler doesn't

    You may be having a permissions issue with the scheduler. To fix this you will need to give the scheduler permission to run your script. This can be accomplished with the unix command chmod. I would do something like  chmod 750 /usr/interfaces/scripts/ccs_rename.pl Then just schedule your script to run directly as '/usr/interfaces/scripts/perl ccs_rename.pl '

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2024-04-18 15:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found