[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

cron and stty



I am trying to run a bash script as a cron job but need specific 
kernel parameters that are not defaults. 

i have a bash script that pipes date to a text file:

#! /bin/sh

<snip>

export COLUMNS=160 LINES=80
stty cols 160 rows 80

/home/me/myscript.sh > outfile.txt

<snip>


this syntax works fine if i run this bash script from an xterm. the 
gist of this is  myscript.sh needs environment variables COULMNS 
and LINES to be of these particular values. for some reason that 
i do not understand, these values to not seem to affect the pipe 
operation. i use the stty command to change the _cols_ and _rows_ 
parameters at the kernel level. again, everything works as i wish 
when this is called from any xterm of any size.

when this is run as a cron job, however, cron does not like the _stty_ 
and reports in an email at conlusion of the job

stty: standard input: Invalid argument

i have done some reading ... something about cron not supporting 
stty. for this cron job to work, i must be able to set the standard 
input parameters as i need to ... whatever the default values the 
kernel uses for the cron job are too small and truncate the data 
during the pipe operation. 

how can i resolve this in the cron job?











Reply to: