Unix Technical Forum

cron bash scripting troubles

This is a discussion on cron bash scripting troubles within the Slackware Linux Support forums, part of the Unix Operating Systems category; --> Hey all, Having trouble understanding the problem with the following command from within a script: comm -23 <(grep 'sshd.*Connection ...


Go Back   Unix Technical Forum > Unix Operating Systems > Slackware Linux Support

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-20-2008, 06:36 AM
zzyzx.jp@gmail.com
 
Posts: n/a
Default cron bash scripting troubles

Hey all,

Having trouble understanding the problem with the following command
from within a script:

comm -23 <(grep 'sshd.*Connection from\|Invalid' /var/log/sshd.log)
$WKLOG > $TMPLOG

It runs fine from the command line (w/ filenames not variables) and
when I execute the script myself, ./<script>, but when it runs from
cron it chokes on this line. The stderr output is:

line 11: syntax error near unexpected token `('
line 11: comm -23 <(grep 'sshd.*Connection from\|Invalid'
/var/log/sshd.log) $WKLOG > $TMPLOG

Any idea what's causing the change from command line to cron? Does cron
run through a different shell? Both are running as root.

Thanks for any help!

jp

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-20-2008, 06:38 AM
zzyzx
 
Posts: n/a
Default Re: cron bash scripting troubles

Problem solved. I forgot the magic #!/bin/bash line which obviously
caused problems with cron.

jp

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:57 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com