#5 Unable to echo to file

open
nobody
None
5
2014-08-28
2004-05-06
Anonymous
No

I appreciate any help on this.

I installed Swatch on Solaris 8 and it seems to be
echoing the output as desired on the command line.
However, when I setup the rc file to send outputs to a
file it would not do it.

Config file:

watchfor /10.2.2.2/
echo
exec echo $0 >> /tmp/swtest.log

I run swatch using the syntax:

swatch --config-file=swatchrc.test --use-cpan-file-tail -
-tail-file=/var/log/logfile

I only get the output "//.swatch_script.16050" on the
swtest.log file.

Am I missing something.

Thanks
Srikanth
nsrikanth@hotmail.com

Discussion

  • irina
    irina
    2004-05-29

    Logged In: YES
    user_id=1052255

    you need to use very poorly documented option
    "--awk-field-syntax"
    for exec/pipe to work with $0 or $*. or you can modify
    convert_command in swatch do not use this switch.

     
  • Logged In: NO

    Try workaround (for v. 3.1.1 at least):

    watchfor /10.2.2.2/
    echo
    pipe cat >> /tmp/swtest.log

     
  • Logged In: NO

    You need to use the $_ to echo the actual message

    stefan@emg.za.net