Re: Expect and backspace characters

From: Cameron Laird (claird_at_lairds.com)
Date: 12/26/03


Date: Fri, 26 Dec 2003 18:49:21 -0000

In article <6b9e86d.0312221125.38e5e1a1@posting.google.com>,
Frost <frostread@yahoo.com> wrote:
>Hello everybody,
>
>I have an Expect script running from the Cron, and have found that the
>output of the script is full of backspace characters (^h), which make
>it somewhat difficult to read in my email client.
>
>I am using "spawn -noecho" when I launch a shell. However, the output
>I receive looks like this:
>
>--------------
>bash-2.05b$ CVSROOT='/data1/cvsroot' /usr/bin/cvs -q up -d
>/home/user/code
></cvsroot' /usr/bin/cvs -q up -d /home/user/coder
> ^H\
>^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^Hoot/scripts/Orders
>? /home/user/coderoot/scripts/Orders/Processing/order_data_in.txt
>--------------
>
>Anybody have an idea of how to preserve the normal script output but
>filter out the local echo and / or the backspace characters that are
>being output to Cron?
                        .
                        .
                        .
It sounds as though you're saying you want "the normal
script output" when run under some circumstances, rather
than the output you observe when running as cron. While
there are a number of ways to approach this, I'd invest-
igate how to make cron processes behave as "normal" ones.
It's likely you just need to set the TERM environment
variable or some other one-liner.

Expect FAQs frequently involve cron.

-- 
Cameron Laird <claird@phaseit.net>
Business:  http://www.Phaseit.net


Relevant Pages

  • Re: Query regarding cron jobs
    ... The script is getting executed a few times when scheduled through cron ... The probability of successful execution is 6/10. ... showing any entries crontab -l as the entry in /etc/cron.d is for root ...
    (RedHat)
  • Re: Query regarding cron jobs
    ... The script is getting executed a few times when scheduled through cron ... The probability of successful execution is 6/10. ... showing any entries crontab -l as the entry in /etc/cron.d is for root ...
    (RedHat)
  • SUMMARY: cron entry: nth day of every month?
    ... cron can not handle this with its own syntax. ... 21st but "command" only runs if the output of the "date" command ... What I would suggest is rather than embedding the logic in each script ... The answer is it is _not_ possible to control it only with crontab ...
    (Tru64-UNIX-Managers)
  • Re: Cron Jobs
    ... > having a cron will mean yo server is forced by the script ... > best than allowing mail dequeing by connection. ... > host server so I can get emails for my domain example.com. ...
    (RedHat)
  • [Solved] Long cronjobs terminate after 2 minutes/Ubuntu 8.10
    ... When I run the script in the foreground, it takes about 2 hours to ... Have you got your system set up so that cron sends mail to ... I configured Postfix for local mail only and updated ... I'm assuming that configuring the MTA is what did it. ...
    (Ubuntu)