[CentOS] CentOS 7 bash perhaps off topic

Mon Nov 26 20:19:42 UTC 2018
KM <info4km at yahoo.com>

 So you are saying that the actual "while read line do ….. done …." is what is failing?Try sending the output of the smwebsocket "$URL" | grep Location so we may see what is being passed to the while read line.
Additionally you could use sh -x to execute it and it may show something.
You could send the code exactly also.K
    On ‎Monday‎, ‎November‎ ‎26‎, ‎2018‎ ‎03‎:‎11‎:‎14‎ ‎PM‎ ‎EST, Jerry Geis <jerry.geis at gmail.com> wrote:  
 hi all,

I have a small script that seems to be exiting and hitting the sleep 60...
The smwebsocket just connects to the web socket provided and outputs the
data. This works manually.

the myprogram just opens a database and writes the line...

My desire is to run the smwebsocket, connect to the websocket and output
the data (line by line) when we get a line that matches Location take that
line and output to the database. Seems simple. I desire this to keep the
connection alive and just continue to read data and grep on the data etc...
if smwebsocket does exit, sleep 60 and reconnect.

However it seems to be exiting and running the sleep 60. Am I missing
something ?

while [ 1 ]
                        smwebsocket "$URL" | grep Location | while read line
                                myprogram -data "$line"

                sleep 60

All the pieces work - just not the actual running.  What am I missing?

CentOS mailing list
CentOS at centos.org