Hear.sh

Mathieu Deschamps mdeschamps at mangrove-systems.com
Mon May 24 02:21:00 CEST 2004


Typically this is a ' or a " that's not close where it should, maybe
have i missed copy/paste the script. Anyhow here are a new version. Let
me know if it goes wrong. Both theses script in the same directory.


Hear script--------------

#!/bin/sh
#
# Hear script  listen & log onto ttyS0 (serial port a.k.a COM1)
#
#
VERSION="24/05/04|09:32:49 MD"
SPEED="115200"
i="Bienvenu(e) dans Hear! v. $VERSION j'ecoute sur ttyS0 ..."
ter=`tty`
if [ "x$1" = "x" ]; then
  echo "Usage $0 log_to_file"
  exit 0
 else
  LOG="$1"
fi
echo $i
echo  "Logging in $LOG"
stty ispeed $SPEED
stty | tee -a "$LOG"
echo "****************************************************" >>"$LOG" 
echo " Hear! Boot Log started on `date +%d/%m/%y\|%T` " >> "$LOG"
echo "  tty in use : $ter  from ttyS0 " >>"$LOG"
echo "****************************************************" >>"$LOG"

  /usr/bin/time -pao "$LOG" -- cat -sbA </dev/ttyS0 | tee -a "$LOG" 
  
  ./digest.sh "$LOG" -s

  echo "----------------------------------------------" >> "$LOG"
  echo -e "\n"
  echo "Please add a comment to this boot log .."
  sleep 3 
  vi tmp
  echo -e "Comments :\n" >> "$LOG"
  cat tmp >> "$LOG"
  rm -f tmp

  echo "done."




Digest script--------------



#!/bin/bash
#
# Script to digest hard-human readable hear! logs
#  Mathieu Deschamps for mangrove-systems
#
VERSION="11/05/04|09:40:28 MD"
SUPP=0
DAT="`date +%d\-%m\-%y\ %T`"
if  [ "x$1" = "x"  ]; then
        echo "usage: $0 hear!_log_file [--suppress-log,-s] " 
        echo "v. $VERSION"
        exit 0
  else
        FIL="$1"
fi

[ "x$2" = "x-s" ] || [ "x$2" = "x--suppress-log" ]  && SUPP=1

if [ -f "$FIL.adv" ]; then
  mv "$FIL.adv"  "$FIL.adv.$DAT"
fi



cat $FIL | while read line; 
        do 
                [ "x$line" != "x$" ] && echo "$line"
        done >  "$FIL.adv"

mv -f $FIL $FIL.digested
mv -f $FIL.adv $FIL
( [ $? -eq 0 ];  echo "$FIL digested, rename old as $FIL.digested" ) ||
echo "Digestion gets harden ...blurp (error) "

[ $SUPP -eq 1 ] && rm -f $FIL.digested 2>&1 >/dev/null 



Le ven 21/05/2004 à 17:28, Thomas Spear a écrit :
> Mathieu -
> 
> I can't run your hear.sh script.  I get "Line 25: unexpected end of file" 
> when I try.  What do I need to do to fix it?  Thanks.
> 
> _________________________________________________________________
> FREE pop-up blocking with the new MSN Toolbar  get it now! 
> http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
> 
> 



More information about the coreboot mailing list