sh interactive?

2005-03-26 Thread Alejandro Pulver
Hello, How can I use 'sh' as an interactive shell? My configuration files are the defaults. The file '.profile' has the following: [...] # set ENV to a file invoked each time sh is started for interactive use. ENV=$HOME/.shrc; export ENV [...] The file '.shrc' has the following: [...] #

Re: .sh interactive ok, from crontab, not

2002-11-25 Thread Matthew Seaman
On Mon, Nov 25, 2002 at 07:47:46AM +0100, Len Conrad wrote: Try running 'ps' using the -w flag (wide column mode): if ( ps -auxw | grep -iq ^root.*master ) ; then I've tested this and it works. here, too, thanks!! One -w switches from 80 column width to 132 column width, but two -w's

.sh interactive ok, from crontab, not

2002-11-24 Thread Len Conrad
Trying to write a little watch-dog/keep-alive script for a couple of related daemons, an MTA and an SMTP AV scanner. This snippet works fine... if ( ps aux | grep -i ^root.*master ) /dev/null then echo then: exit code equal 0 exit 0 else try to run the daemon ... when run from the command

Re: .sh interactive ok, from crontab, not

2002-11-24 Thread Paul A. Scott
From: Len Conrad [EMAIL PROTECTED] snip This snippet works fine... if ( ps aux | grep -i ^root.*master ) /dev/null then echo then: exit code equal 0 exit 0 else try to run the daemon ... when run from the command line, the echo text displays. But, when run from crontab every 10

Re: .sh interactive ok, from crontab, not

2002-11-24 Thread Len Conrad
if ( ps aux | grep -i ^root.*master ) /dev/null then echo then: exit code equal 0 exit 0 else try to run the daemon ... when run from the command line, the echo text displays. But, when run from crontab every 10 minutes, the if fails, and the else clause runs. I've tried every syntax

Re: .sh interactive ok, from crontab, not

2002-11-24 Thread Paul A. Scott
From: Len Conrad [EMAIL PROTECTED] It works for me, and I suspect that it's working for you, too. well, it's really not. The crontab execution is trying to run the daemon even when the daemon shows up in ps aux. Well, it was just a guess. :) I tested against my 'named' daemon, using the

Re: .sh interactive ok, from crontab, not

2002-11-24 Thread Len Conrad
Well, it was just a guess. :) I tested against my 'named' daemon, using the code you supplied and it works fine. same code works fine for my AV daemon, but not for the MTA daemon What version of FreeBSD? 4.5 Are you using the 'stock' shell? yes Did you look at the output from grep

Re: .sh interactive ok, from crontab, not

2002-11-24 Thread Paul A. Scott
I forgot to mention, I'm blue in the face Sorry, didn't know what you'd already done. Thought I had to ask. ... but your version, or my multiple versions, have never mishaved from the command line, it's running from crontab that does comes out inverted. What does your crontab entry look

Re: .sh interactive ok, from crontab, not

2002-11-24 Thread Len Conrad
What does your crontab entry look like? */10* * * * root/usr/local/bin/watchdog.sh To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-questions in the body of the message

Re: .sh interactive ok, from crontab, not

2002-11-24 Thread Paul A. Scott
Okay, I was able to duplicate your problem. It is due to the output of 'ps' being truncated to 80 columns, the default terminal size. You are likely running a wide terminal display on your interactive session (as I do) but cron will see the default 80 column terminal. This is the difference

Re: .sh interactive ok, from crontab, not

2002-11-24 Thread Len Conrad
Okay, I was able to duplicate your problem. It is due to the output of 'ps' being truncated to 80 columns, the default terminal size. You are likely running a wide terminal display on your interactive session (as I do) yep, TeraTerm on Windows, very wide display. but cron will see the