Hello, I'm working on a shell script on FreeBSD specifically an rc startup script but I'm hoping what i'm asking is not BSD-specific but rather an sh shell syntax question. I've got a program that when daemonized it runs on 127.0.0.1 on port 5953, I am attempting to get that process, which does not have it's own pidfile (nor does it have the option support to make one), but does show up in a sockstat output, and kill it. If at the bash shell I do: sockstat -l4|grep 5953|awk '{print $3}' I get the specific number i'm wanting to kill and no more. If I put that command in my rc script stop section when that command is run I get the whole sockstat line, It finds the specific line I'm needing but does not find the specific number I'm looking for. What I've tried: fsstop="sockstat -l4|grep 5953|awk '{print $3}'" #stop_cmd="sockstat -l4|grep 5953|awk -F " " '{print $3}'|killall -" stop_cmd="${fsstop}" I'm assuming what i'm hitting is an sh vs bash shell difference. I'd appreciate any suggestions. Thanks. Dave.
participants (1)
-
David Mehler