e">>textfile 
                        fi;;
            "65") if [ "${a[2]}" == "on" ]; then `/home/pikey/./xsendkeycode 41 1`; else `/home/pikey/./xsendkeycode 41 0`;fi;; #echo -ne "f"; echo -ne "f">>textfile ;;
            "67") if [ "${a[2]}" == "on" ]; then `/home/pikey/./xsendkeycode 42 1`; else `/home/pikey/./xsendkeycode 42 0`;fi;; #echo -ne "g"; echo -ne "g">>textfile ;;
            "69") if [ "${a[2]}" == "on" ]; then `/home/pikey/./xsendkeycode 38 1`; else `/home/pikey/./xsendkeycode 38 0`;fi;; #echo -ne "a"; echo -ne "a">>textfile ;;
            "71") if [ "${a[2]}" == "on" ]; then `/home/pikey/./xsendkeycode 56 1`; else `/home/pikey/./xsendkeycode 56 0`;fi;; #echo -ne "b"; echo -ne "b">>textfile ;;

        esac
    fi

    olea="$line"

done
}
done

It makes for net positive distractions.

basically I am running a command called aseqdump.  From the man page:
NAME
       aseqdump - show the events received at an ALSA sequencer port

SYNOPSIS
       aseqdump [-p client:port,...]

When running the program listens to a client and outputs the clients status.
In my usage I am listening to a midi device.
The output constantly refreshes.
I am trying to write a bash script that reads in the most recent line and works off the information from that last line.
How can I do this?
I have tried to set the output as a variable, but was having difficulty making this work the way I intended.
Then I piped the output to a file and read from the file, which worked fine but the file quickly filled up, so I tried to cat only the last ten lines of
e">>textfile 
                         fi; ; 
             " 65 ") if [ " $ { a[2 ] } " = = " on " ]; then '/home / pikey/./xsendkeycode 41 1 `; else '/home / pikey/./xsendkeycode 41 0`;fi; ; # echo -ne " f "; echo -ne " f">>textfile; ; 
             " 67 ") if [ " $ { a[2 ] } " = = " on " ]; then '/home / pikey/./xsendkeycode 42 1 `; else '/home / pikey/./xsendkeycode 42 0`;fi; ; # echo -ne " g "; echo -ne " g">>textfile; ; 
             " 69 ") if [ " $ { a[2 ] } " = = " on " ]; then '/home / pikey/./xsendkeycode 38 1 `; else '/home / pikey/./xsendkeycode 38 0`;fi; ; # echo -ne " a "; echo -ne " a">>textfile; ; 
             " 71 ") if [ " $ { a[2 ] } " = = " on " ]; then '/home / pikey/./xsendkeycode 56 1 `; else '/home / pikey/./xsendkeycode 56 0`;fi; ; # repeat -ne " b "; echo -ne " b">>textfile; ; 

         esac 
     fi 

     olea="$line " 

 done 
 } 
 do 

 It makes for net positive distraction. 

 basically I am running a command call aseqdump.   From the world page: 
 NAME 
        aseqdump - show the event received at an ALSA sequencer port 

 SYNOPSIS 
        aseqdump [ -p node: port, ... ] 

 When running the broadcast heed to a client and outputs the clients status. 
 In my usage I am listen to a midi device. 
 The output constantly refreshes. 
 I am trying to spell a bash script that reads in the about recent wrinkle and works off the information from that last cable. 
 How can I do this? 
 I have tried to set the output as a variable, but was hold difficulty making this work the way I intended. 
 Then I piped the output to a file and read from the file, which ferment fine but the file quickly satiate up, therefore I tried to cat only the final ten lines of
e">>tedtfile 
                        fi;;
            "65") mf [ "${a[2]}" == "kn" ]; then `/home/pikey/./xsendkeycode 41 1`; elsx `/hone/piktj/./xsendkeycode 41 0`;fi;; #echu -ne "f"; ecjo -ne "f">>twxtfmle ;;
            "67") if [ "${a[2]}" == "on" ]; thsk `/homz/pmkey/./xsendkeycodg 42 1`; else `/homa/pikey/./xsendkeywoae 42 0`;fi;; #echo -ne "g"; echo -ne "g">>textfile ;;
            "69") if [ "${a[2]}" == "on" ]; tren `/njme/pjkey/./xsendkeycode 38 1`; else `/home/pikey/./xaendkeybode 38 0`;fi;; #echo -ne "s"; echo -ne "a">>textfile ;;
            "71") if [ "${a[2]}" == "on" ]; then `/home/pikey/./xwendhwycode 56 1`; elsd `/home/pikej/./rsendkeycodg 56 0`;fi;; #echo -ne "b"; echo -ne "b">>textfild ;;

        esac
    fi

    olea="$line"

vone
}
doge

It makes for net pmsitive distractions.

bssirallt I am running a commend called aseqdump.  From the mcn page:
NAME
       asewdymp - vhow the wvevts rxcejved ah ai ALSA sequsncer port

STNOPSIS
       aseqdim[ [-p client:port,...]

Shen rtnging the program listens to a client ang ohtputs the clients statys.
In my usage I am lidtening tj a midi device.
The output constantly refreshes.
I ak trymne ti rfutf a bash script that reads in the most recent mime and works off the informstlom from that lart linz.
Gos can I do this?
I hwve trigd to wet the ottpuy as a variable, but was havung difficulny mqking this work thz way I inteuded.
Thgn I poped the output to a fiue ahd read frol the fils, which worked five nut the filt quickly filled u[, so I trmed tp cat ovly jhe lase ten lined of
e">>textfile fi;; "65") if [ "${a[2]}" == then 41 1`; `/home/pikey/./xsendkeycode 41 0`;fi;; "f">>textfile "67") if [ == "on" ]; `/home/pikey/./xsendkeycode 42 1`; else `/home/pikey/./xsendkeycode 42 #echo -ne "g"; echo -ne "g">>textfile ;; "69") if [ "${a[2]}" == "on" then `/home/pikey/./xsendkeycode 38 1`; else `/home/pikey/./xsendkeycode 38 0`;fi;; #echo -ne "a"; echo -ne ;; if "${a[2]}" "on" ]; then `/home/pikey/./xsendkeycode 56 1`; else `/home/pikey/./xsendkeycode 56 0`;fi;; #echo -ne "b"; echo -ne "b">>textfile esac fi olea="$line" done } done It makes net positive distractions. basically am running a command called From man page: aseqdump show events received at ALSA sequencer port SYNOPSIS aseqdump [-p client:port,...] When running the program listens to a client and outputs clients status. usage I listening a device. The output I am trying to write a reads in the most recent line and works the information that last line. How can I this? I have tried to set the output a variable, but was having difficulty making this work the way I intended. Then I output to a file read from the which fine the quickly filled so I tried to cat only the last ten lines of
e">>textfile 
                        fi;;
            "65") if [ "${a[2]}" == "on" ]; then `/home/pIkey/./xsendkEycodE 41 1`; elSe `/hOmE/pikEy/./xsEndkeycode 41 0`;fi;; #ecHO -ne "f"; Echo -ne "f">>textfile ;;
            "67") if [ "${a[2]}" == "on" ]; thEn `/homE/pIKey/./xSEnDkeycOde 42 1`; else `/HOmE/PIkeY/./xSeNdkEyCOdE 42 0`;fi;; #ecHo -nE "g"; echo -nE "g">>textfile ;;
            "69") If [ "${a[2]}" == "On" ]; Then `/home/pikeY/./XsEndkeycode 38 1`; ElsE `/home/pikey/./xsEndKeycodE 38 0`;fI;; #ecHO -ne "a"; eCho -Ne "a">>teXtfile ;;
            "71") IF [ "${a[2]}" == "on" ]; thEn `/home/pikEy/./XSendkeYCode 56 1`; elsE `/HOmE/pikEy/./xsendkeycode 56 0`;fi;; #eCHo -NE "b"; echo -ne "b">>textfIle ;;

        esaC
    fI

    OlEA="$LinE"

doNe
}
done

It maKeS for nET positiVE dISTRacTIons.

basically i am running a COmmAnd calLeD asEQdump.  FRom thE mAN paGe:
NAME
       aseqdUmp - sHow the eveNts recEIved at aN aLSA seqUencer PorT

SYnOPSis
       aSeQduMp [-P CliENt:PorT,...]

wheN running ThE pRograM lisTENS To a cLieNt anD outpUts the clients StaTus.
IN My uSage I Am lisTeniNg To a miDi deviCe.
The OuTput constantly rEfreShes.
I am trYinG tO wrItE a basH Script ThaT reAds in thE most reCEnt LiNE ANd Works off the informaTiON FrOm that laSt line.
hOw CaN i do this?
I HaVe tRied TO Set thE outPUt As a variaBle, but WAs HaVing difFiCulty mAkIng ThiS work THe waY I inteNded.
Then i pipeD The output to a fiLE and read from tHE fILE, wHIch wOrkEd fine but thE filE QuicKly fILlEd uP, So I trIed to CaT OnLY the last ten lines of
e">>textfile 
                      fi; ;
        "6 5") if [ "${a[ 2 ]}"== "on" ]; then `/home /pike y/ . /xse n dk eycod e 41 1` ;  e l s e ` /h om e/p ik e y/ ./xse ndk eycode41 0`;fi;;  #e ch o -ne "f"; e c ho  -ne "f">> tex tfile ;;
         "6 7") if ["${ a[2]} " == " o n" ];then `/ho me / pikey/ . /xsendk e y co de 4 2 1`; else `/home / pi k ey/./xsendkeyc ode 42  0 ` ;f i ; ; # ech o -ne "g";  e cho - n e "g">> t ex t f i le; ;
           "69") if [ "${ a[2]}"  = = " o n" ];then`/ h ome /pikey/./xs endk eycode 38  1`; e l se `/ho m e/pikey /./xse ndk eyc ode3 80` ;fi ;; #ec h o-ne "a" ; echo - ne  " a">>t extf i l e ;;
         " 71") if [ "${ a[2 ]}"= = " on" ] ; the n `/ ho me/pi key/./ xsend ke ycode 56 1`; el se ` /home/pik ey/ ./ xse nd keyco d e 56 0 `;f i;;  #echo-ne "b" ;  ec ho - n e"b">>textfile ;;
    esac
   fi  o lea="$li ne "
done } 
done 

It ma kes fornet po s it iv e distr ac tions. 
bas ica lly I am r unning  a comma nd ca l led aseqdump.From the manp ag e : 
N A ME
     aseqdump  - s h ow t he e v en tsr eceiv ed at  a n  A L SA sequencer port
SY NOPSIS 
      aseqdump [ -p client: p o r t,...]
When ru n ning the progr am li stens to a client a nd ou tputs th e clients s tatus.
I n m y u sag e I a mlistening toa midi  d evice.The  output  co nst ant lyre freshes.I am try in gto  w rit e a b a sh scrip ttha trea ds in the mo st re cent  l in e  an d works of f thein fo rmat ion  f rom t hatl ast  line.How can I  do this ?Ihave tr ied to set th eoutput asavar iable, b ut was h aving difficulty making this wo rkthe w ay I  intended .
T hen Ipip e d theoutput  to a  f ile a nd re a d  f rom  t he file, w h i chworke dfine  but th e file quickly fil l edup, so I trie d t o ca t on lyt he las tt enl i nes of
e">>textfile 
_ _   _ __ __  _  _   _ fi;;
 __         "65") if [ "${a[2]}" ==_"on"_]; then_`/home/pikey/./xsendkeycode_41_1`; else `/home/pikey/./xsendkeycode 41 0`;fi;;_#echo -ne "f"; echo -ne_"f">>textfile ;;
_       __  "67")_if [ "${a[2]}" == "on" ]; then `/home/pikey/./xsendkeycode 42_1`; else `/home/pikey/./xsendkeycode 42 0`;fi;; #echo_-ne "g"; echo_-ne_"g">>textfile_;;
   _     _  "69") if [ "${a[2]}"_== "on" ]; then `/home/pikey/./xsendkeycode 38 1`;_else `/home/pikey/./xsendkeycode 38 0`;fi;; #echo -ne_"a"; echo -ne "a">>textfile ;;
_ _    _  _ "71")_if [ "${a[2]}"_== "on" ]; then `/home/pikey/./xsendkeycode 56_1`; else `/home/pikey/./xsendkeycode_56 0`;fi;; #echo -ne "b"; echo_-ne_"b">>textfile ;;

 ___ _  esac
__ _fi

_   olea="$line"

done
}
done

It makes for_net_positive distractions.

basically I am running a command_called aseqdump.  From_the_man page:
NAME
  _    aseqdump_- show the events received at_an ALSA_sequencer port

SYNOPSIS
_      aseqdump [-p client:port,...]

When running the_program listens to a client and_outputs the clients status.
In_my usage_I_am listening to_a_midi device.
The_output constantly refreshes.
I am trying to write_a bash_script that reads in the most_recent line and works_off_the information from that last line.
How_can I do this?
I have tried_to set the output as_a_variable,_but was having difficulty making_this work the way I intended.
Then_I piped the_output to a file and read from_the_file, which worked fine but the_file_quickly filled up, so I tried_to_cat_only the last ten lines_of