a gizmo on com1 - string eval & if


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting a gizmo on com1 - string eval & if
# 1  
Old 09-10-2009
a gizmo on com1 - string eval & if

friends,

i have a gizmo ( vk011) that plugs into my comport ( centOS5.3 )
this I listen to via minicom and it will spit out the temp in the room like this.
Sensor 1 +70.13 DegF Hi +77.56 DegF Low +29.75 DegF
Sensor 1 +70.13 DegF Hi +77.56 DegF Low +29.75 DegF
Sensor 1 +70.13 DegF Hi +77.56 DegF Low +29.75 DegF
... over and over...

My goal is to have a script that I can cron and have it ALARM if the temp in the room exceeds a num (80)

I have found I can write 1 line to a file (01.txt) if i

head -1 /dev/ttyS0 > 01.txt

this has 1 line of

Sensor 1 +70.13 DegF Hi +77.56 DegF Low +29.75 DegF

so _ i am wishing to then read that file.
look at characters position 11 & 12 -- basically get the 70.
and do an if . if that is above 80 then do something.

i *think I already know how to send an email via a bash.
but how do i do this in string eval and have it If.
The sending of an email is the something i wish to do.

There may be a way to assess this temperature value without writing to a file... but this is what I have so far

I have tried perl... But a bash script solution would be wonderful.

thanks
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. HP-UX

Hp rx2620: is possible to access ILO via serial COM1?

Fast question: a bad reset put ilo ip to 127.0.0.1(!) and now i cannot reach via network Is possible to get ilo via serial using COM1/console? I see three console ports on server back side two are standard and one is reachable only with this cable... 403 Forbidden but i don't have this... (0 Replies)
Discussion started by: Linusolaradm1
0 Replies

2. Shell Programming and Scripting

Error in eval eval command to print html tags

anyone has any info on why this is complaining??? vivek@vivek-c5e55ef2e ~/TAC $ zoneCounter=1 vivek@vivek-c5e55ef2e ~/TAC $ optUsage1=23% vivek@vivek-c5e55ef2e ~/TAC $ eval eval echo "<th>Zone $zoneCounter </th><th align=\"left\"> \$optUsage$zoneCounter </th>" -bash: syntax error... (13 Replies)
Discussion started by: vivek d r
13 Replies

3. Shell Programming and Scripting

Error in eval eval command to print html tags

anyone has any info on why this is complaining??? vivek@vivek-c5e55ef2e ~/TAC $ zoneCounter=1 vivek@vivek-c5e55ef2e ~/TAC $ optUsage1=23% vivek@vivek-c5e55ef2e ~/TAC $ eval eval echo "<th>Zone $zoneCounter </th><th align=\"left\"> \$optUsage$zoneCounter </th>" -bash: syntax error... (1 Reply)
Discussion started by: vivek d r
1 Replies

4. Shell Programming and Scripting

Strange result of eval, how does eval really work with ssh?

Hi all, some small script with eval turned me to crazy. my OS is linux Linux s10-1310 2.6.16.53-0.8.PTF.434477.3.TDC.0-smp #1 SMP Fri Aug 31 06:07:27 PDT 2007 x86_64 x86_64 x86_64 GNU/Linux below script works well #!/bin/bash eval ssh remotehost date eval ssh remotehost ls below... (1 Reply)
Discussion started by: summer_cherry
1 Replies

5. Shell Programming and Scripting

PHP read large string & split in multidimensional arrays & assign fieldnames & write into MYSQL

Hi, I hope the title does not scare people to look into this thread but it describes roughly what I'm trying to do. I need a solution in PHP. I'm a programming beginner, so it might be that the approach to solve this, might be easier to solve with an other approach of someone else, so if you... (0 Replies)
Discussion started by: lowmaster
0 Replies

6. Shell Programming and Scripting

Find & Replace string in multiple files & folders using perl

find . -type f -name "*.sql" -print|xargs perl -i -pe 's/pattern/replaced/g' this is simple logic to find and replace in multiple files & folders Hope this helps. Thanks Zaheer (0 Replies)
Discussion started by: Zaheer.mic
0 Replies

7. Shell Programming and Scripting

Help with eval usage for string containing Environment Variable

Help !! First, Thanks in Advance Here is what I have I have an environment Variable, let's call it v_VALUE. v_VALUE="\$ORACLE_HOME/bin" Hence, the location is ORACLE_HOME is not evaluated. ORACLE_HOME happens to be /app/oracle/product/10.1.2 I need a method of returning the... (1 Reply)
Discussion started by: dhangliter
1 Replies

8. Shell Programming and Scripting

How do I search first&second string & copy all content between them to other file?

Hi All, How do I search first string & second string and copy all content between them from one file to another file? Please help me.. Thanks In Advance. Regards, Pankaj (12 Replies)
Discussion started by: pankajp
12 Replies

9. Shell Programming and Scripting

Replacing Last occurance of &amp; from a string

Hi All, Could anyone help me out in the below requirement: I have a text(XML) file like this: - <Dim2> <Properties Name="" State="2" ShowHir="-1" ApplyFilter="-1" ExpandToLevel="1" BreakHierType="1" MaxDepth="1" SlicerSelectOptions="1" ShowLeaf="0" HasGroup="0" /> <Expanded... (1 Reply)
Discussion started by: vivekshady
1 Replies
Login or Register to Ask a Question
vpcd(8) 							     powerman								   vpcd(8)

NAME
vpcd - virtual power control daemon SYNOPSIS
vpcd [--port PORT] DESCRIPTION
vpcd is a test program for PowerMan which emulates a remote power control device. It can be run interactively by the powerman daemon, or it can listen on a port of your choosing. OPTIONS
-p, --port PORT Instructs vpcd to listen for connections on the specified port instead of using stdin/stdout. Only one connection will be accepted. INTERACTIVE COMMANDS
The following commands are available at the vpcd> prompt: login The login command must br run before any of the other commands will work. No username or password is required. logoff Return vpcd to the initial state. stat PLUG|* Show the power status of PLUG. If PLUG is ``*'', perform this action on all plugs. beacon PLUG|* Show the beacon status of PLUG. If PLUG is ``*'', perform this action on all plugs. temp PLUG|* Show the temperature of the node attached to PLUG. If PLUG is ``*'', perform this action on all plugs. spew COUNT Print COUNT 80-char lines. This is the basis of a buffer handling test. on PLUG|* Turn on PLUG. If PLUG is ``*'', perform this action on all plugs. off PLUG|* Turn off PLUG. If PLUG is ``*'', perform this action on all plugs. flash PLUG|* Light the beacon on PLUG. If PLUG is ``*'', perform this action on all plugs. unflash PLUG|* Unlight the beacon on PLUG. If PLUG is ``*'', perform this action on all plugs. reset PLUG|* Reset the node attached to PLUG. If PLUG is ``*'', perform this action on all plugs. FILES
/usr/sbin/vpcd ORIGIN
PowerMan was originally developed by Andrew Uselton on LLNL's Linux clusters. This software is open source and distributed under the terms of the GNU GPL. SEE ALSO
powerman(1), powermand(8), httppower(8), plmpower(8), vpcd(8), powerman.conf(5), powerman.dev(5), powerman-devices(7). http://sourceforge.net/projects/powerman powerman-2.3.5 2009-02-09 vpcd(8)