Workaround (don't laugh; it works)

Robert Brockway robert-5LEc/6Zm6xCUd8a0hrldnti2O/JbrIOy at public.gmane.org
Sun Sep 21 15:10:41 UTC 2003


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.

A couple of years ago I saved some Solaris developers from pulling
all their hair out by suggesting this one :)

Rob

-- 
Robert Brockway B.Sc. email: robert-5LEc/6Zm6xCUd8a0hrldnti2O/JbrIOy at public.gmane.org, zzbrock at uqconnect.net
Linux counter project ID #16440 (http://counter.li.org)
"The earth is but one country and mankind its citizens" -Baha'u'llah
--
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