Workaround (don't laugh; it works)

waltdnes-SLHPyeZ9y/tg9hUCZPvPmw at public.gmane.org waltdnes-SLHPyeZ9y/tg9hUCZPvPmw at public.gmane.org
Sun Sep 21 19:37:00 UTC 2003


On Sun, Sep 21, 2003 at 11:10:41AM -0400, Robert Brockway wrote
> On Sun, 21 Sep 2003 waltdnes-SLHPyeZ9y/tg9hUCZPvPmw at public.gmane.org wrote:
> 
> >   I can only get this to work from a real shell, and not crontab.  So
> > opened up a new tty by going {ALT-F4} and logging in.  I created the
> > following script and ran it...
> 
> Walt, try running a script from cron (as you were trying before) but have
> the first line as #!/bin/bash -i rather than just /bin/bash.  This creates
> a bash environment equivalent to your interactive environment.  If bash
> realises it isn't being run interactively (eg, from cron) it won't execute
> commands in ~/.bashrc.  It knows when it is being run interactively
> because it will have a terminal attached.

  It almost looks as if it *INSISTS* on a real live shell.  Here's what
I get when using -i

bash: no job control in this shell
No value for $TERM and no -T specified
No value for $TERM and no -T specified
sh: line 1: gettext: command not found
No recipients were specified.

-- 
Walter Dnes <waltdnes-SLHPyeZ9y/tg9hUCZPvPmw at public.gmane.org>
Email users are divided into two classes;
1) Those who have effective spam-blocking
2) Those who wish they did
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list