Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

I can recreate your problem now.

me@mybox:/home/me/sandbox $ cat 1.pl #!/usr/bin/perl system('echo bob >/tmp/blarney.out'); me@mybox:/home/me/sandbox $ ./1.pl me@mybox:/home/me/sandbox $ cat /tmp/blarney.out bob me@mybox:/home/me/sandbox $ rm /tmp/blarney.out me@mybox:/home/me/sandbox $ at -f 1.pl now Job me.1323356661.a will be run at Thu Dec 8 10:04:21 EST 2011. me@mybox:/home/me/sandbox $ at -l me@mybox:/home/me/sandbox $ ls -l /tmp/blarney.out ls: 0653-341 The file /tmp/blarney.out does not exist.

When I check my mail, I see the problem. Notice the "command not found" message. This means you must supply full path to the script.

me@mybox:/home/me/sandbox $ mail Mail [5.2 UCB] [AIX 5.X] Type ? for help. "/var/spool/mail/me": 2 messages 1 new 2 unread U 1 daemon Thu Dec 8 10:02 32/950 "Output from at job +1.pl, me" >N 2 daemon Thu Dec 8 10:04 31/940 "Output from at job +1.pl, me" ? 1 Message 1: From daemon Thu Dec 8 10:02:08 2011 Date: Thu, 8 Dec 2011 10:02:08 -0500 From: daemon To: me Subject: Output from at job 1.pl, me@mybox, exit status 127 Cron Environment: SHELL = /opt/freeware/bin/bash PATH=/usr/bin:/etc:/usr/sbin:/usr/bin/X11:/sbin:/usr/java14/jre/bin:/ +usr/java14/bin:/usr/local/bin CRONDIR=/var/spool/cron/crontabs ATDIR=/var/spool/cron/atjobs LOGNAME=me HOME=/home/me Your "at" job executed on mybox on Thu Dec 8 10:02:08 EST 2011 1.pl produced the following output: bash: line 3: 1.pl: command not found ***************************************************************** cron: The previous message is the standard output and standard error of one of the cron commands.

Now with full path supplied.

me@mybox:/home/me/sandbox $ ls -l /tmp/blarney.out ls: 0653-341 The file /tmp/blarney.out does not exist. me@mybox:/home/me/sandbox $ at -f /home/me/sandbox/1.pl now Job me.1323356887.a will be run at Thu Dec 8 10:08:07 EST 2011. me@mybox:/home/me/sandbox $ at -l me@mybox:/home/me/sandbox $ ls -l /tmp/blarney.out -rw-r----- 1 me users 4 Dec 08 10:08 /tmp/blarney.out

In reply to Re: system command is not working by jffry
in thread system command is not working by gulla

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-03-29 06:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found