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":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.