Loading ...
Sorry, an error occurred while loading the content.

Re: noob running perl scripts from cron on the unslung -

Expand Messages
  • Bob Cox
    In article , ... [snip] Do you have: #! /usr/bin/perl as the first line of simple.pl ? (assuming that /usr/bin/perl is your path to
    Message 1 of 6 , Dec 14, 2007
    • 0 Attachment
      In article <fjsrsc+i74n@...>,
      phinas <jim@...> wrote:

      > I am running the newest version of unslung with perl installed. I can
      > run my simple script if I use the command perl simple.pl but if I try
      > to run it by ./simple.pl it tells me that the command in not found. I
      > have chmod'd it with a +x and even a 755 still doesn't work.

      [snip]

      Do you have:

      #! /usr/bin/perl

      as the first line of simple.pl ?

      (assuming that /usr/bin/perl is your path to perl, of course).

      --
      Bob Cox. Stoke Gifford, near Bristol, UK. http://pippin.co.uk/
      Registered user #445000 with the Linux Counter: http://counter.li.org/
      Debian on NSLU2 Slug: http://bobcox.com/slug/
    • James Dougherty
      Bob, Thanks for the quick response. Yes I have #! /usr/bin/perl in the beginning of the script. When I go to that directory you see perl so I believe that is
      Message 2 of 6 , Dec 14, 2007
      • 0 Attachment
        Bob,



        Thanks for the quick response. Yes I have #! /usr/bin/perl in the beginning
        of the script. When I go to that directory you see perl so I believe that is
        correct directory.



        Jim

        _____

        From: nslu2-general@yahoogroups.com [mailto:nslu2-general@yahoogroups.com]
        On Behalf Of Bob Cox
        Sent: Friday, December 14, 2007 4:07 AM
        To: nslu2-general@yahoogroups.com
        Subject: [nslu2-general] Re: noob running perl scripts from cron on the
        unslung -



        In article <fjsrsc+i74n@ <mailto:fjsrsc%2Bi74n%40eGroups.com> eGroups.com>,
        phinas <jim@godougherty. <mailto:jim%40godougherty.com> com> wrote:

        > I am running the newest version of unslung with perl installed. I can
        > run my simple script if I use the command perl simple.pl but if I try
        > to run it by ./simple.pl it tells me that the command in not found. I
        > have chmod'd it with a +x and even a 755 still doesn't work.

        [snip]

        Do you have:

        #! /usr/bin/perl

        as the first line of simple.pl ?

        (assuming that /usr/bin/perl is your path to perl, of course).

        --
        Bob Cox. Stoke Gifford, near Bristol, UK. http://pippin.
        <http://pippin.co.uk/> co.uk/
        Registered user #445000 with the Linux Counter: http://counter.
        <http://counter.li.org/> li.org/
        Debian on NSLU2 Slug: http://bobcox. <http://bobcox.com/slug/> com/slug/





        [Non-text portions of this message have been removed]
      • James Dougherty
        Bob, Am I correct to believe that I need to get my install to be able to execute from a ./ before I can make it a cron job? Thanks for the help, Jim _____
        Message 3 of 6 , Dec 14, 2007
        • 0 Attachment
          Bob,



          Am I correct to believe that I need to get my install to be able to execute
          from a ./ before I can make it a cron job?



          Thanks for the help,

          Jim



          _____

          From: nslu2-general@yahoogroups.com [mailto:nslu2-general@yahoogroups.com]
          On Behalf Of Bob Cox
          Sent: Friday, December 14, 2007 4:07 AM
          To: nslu2-general@yahoogroups.com
          Subject: [nslu2-general] Re: noob running perl scripts from cron on the
          unslung -



          In article <fjsrsc+i74n@ <mailto:fjsrsc%2Bi74n%40eGroups.com> eGroups.com>,
          phinas <jim@godougherty. <mailto:jim%40godougherty.com> com> wrote:

          > I am running the newest version of unslung with perl installed. I can
          > run my simple script if I use the command perl simple.pl but if I try
          > to run it by ./simple.pl it tells me that the command in not found. I
          > have chmod'd it with a +x and even a 755 still doesn't work.

          [snip]

          Do you have:

          #! /usr/bin/perl

          as the first line of simple.pl ?

          (assuming that /usr/bin/perl is your path to perl, of course).

          --
          Bob Cox. Stoke Gifford, near Bristol, UK. http://pippin.
          <http://pippin.co.uk/> co.uk/
          Registered user #445000 with the Linux Counter: http://counter.
          <http://counter.li.org/> li.org/
          Debian on NSLU2 Slug: http://bobcox. <http://bobcox.com/slug/> com/slug/





          [Non-text portions of this message have been removed]
        • John
          ... If you have perl simple.pl working that is enough. Just put /usr/bin/perl /path/to/simple.pl in as your cron command. By the way, for security, cron runs
          Message 4 of 6 , Dec 14, 2007
          • 0 Attachment
            On Fri, Dec 14, 2007 at 06:42:18AM -0500, James Dougherty wrote:
            > Am I correct to believe that I need to get my install to be able to execute
            > from a ./ before I can make it a cron job?

            If you have perl simple.pl working that is enough. Just put
            /usr/bin/perl /path/to/simple.pl in as your cron command.

            By the way, for security, cron runs commands in a reduced
            environment. Even if your program runs from the command line you
            might still have problems if it makes assumptions about the path,
            the current directory, or other environmental issues.

            You might want to verify that /usr/bin/perl is really the right
            path to perl. Run 'which perl' from the command line to find the
            correct path.

            John
          • James Dougherty
            Thank you so much! I got the ./ working and now onto cron. ;) Jim _____ From: nslu2-general@yahoogroups.com [mailto:nslu2-general@yahoogroups.com] On Behalf Of
            Message 5 of 6 , Dec 14, 2007
            • 0 Attachment
              Thank you so much!



              I got the ./ working and now onto cron.



              ;)





              Jim



              _____

              From: nslu2-general@yahoogroups.com [mailto:nslu2-general@yahoogroups.com]
              On Behalf Of John
              Sent: Friday, December 14, 2007 2:07 PM
              To: nslu2-general@yahoogroups.com
              Subject: Re: [nslu2-general] Re: noob running perl scripts from cron on
              theunslung -



              On Fri, Dec 14, 2007 at 06:42:18AM -0500, James Dougherty wrote:
              > Am I correct to believe that I need to get my install to be able to
              execute
              > from a ./ before I can make it a cron job?

              If you have perl simple.pl working that is enough. Just put
              /usr/bin/perl /path/to/simple.pl in as your cron command.

              By the way, for security, cron runs commands in a reduced
              environment. Even if your program runs from the command line you
              might still have problems if it makes assumptions about the path,
              the current directory, or other environmental issues.

              You might want to verify that /usr/bin/perl is really the right
              path to perl. Run 'which perl' from the command line to find the
              correct path.

              John





              [Non-text portions of this message have been removed]
            Your message has been successfully submitted and would be delivered to recipients shortly.