Shell scripting woes.

Julien Gabel jpeg at thilelli.net
Tue Feb 24 13:54:19 PST 2004


>> As a reply to both answers, here's a script that wont' run:
>> #!/usr/local/bin/bash
>> echo start > test.txt
>>
>> ...and here is bash:
>> [root at p3-550 /usr/local/etc]>> whereis bash
>> bash: /usr/local/bin/bash
>>
>> this is /var/log/cron
>> Feb 24 19:20:00 p3-550 /usr/sbin/cron[27988]: (root) CMD
>> (/usr/local/etc/test.sh)
>>
>> This is the crontab entry:
>> * * * * * /usr/local/etc/test.sh
>> (At the moment, I have no shell parameters or other parameters in
>> crontab, another crontab-job runs fine, but that's an executable
>> file.)


The following works fine, here is the detail:

$ date ; ls -lF /tmp/test.*
Tue Feb 24 22:50:11 CET 2004
-rwxr-x---  1 jgabel  wheel  49 Feb 24 22:50 /tmp/test.bash*
$
$ cat /tmp/test.bash
#!/usr/local/bin/bash
echo start > /tmp/test.txt
$
$ crontab -l
* * * * * /tmp/test.bash
$
$ date ; ls -lF /tmp/test.*
Tue Feb 24 22:51:17 CET 2004
-rwxr-x---  1 jgabel  wheel  49 Feb 24 22:46 /tmp/test.bash*
-rw-r--r--  1 jgabel  wheel   6 Feb 24 22:51 /tmp/test.txt
$
$ cat /tmp/test.txt
start
$

Can you try *stricly* the same thing?

-- 
-jg.


More information about the freebsd-questions mailing list