Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!dino!cs.iastate.edu!hascall From: hascall@cs.iastate.edu (John Hascall) Newsgroups: comp.misc Subject: Useful (and clever) pipes Keywords: ps awk sort comm xargs sh (ULTRIX) Message-ID: <2405@dino.cs.iastate.edu> Date: 5 Aug 90 02:03:08 GMT Sender: usenet@dino.cs.iastate.edu Organization: Project Vincent, Iowa State University Computation Center Lines: 19 Here's a pipe which you can use to make sure that your important daemons are re-born should they die (stick this in crontab). It's all one line, divided here for readability (how it works is left as an exercise for the reader :-) ps -wwt\? | awk 'NR != 1 {print substr($0,21)}' | sort -u | comm -13 - /etc/phoenixtab | xargs -l /bin/sh -c /etc/phoenixtab is a list of the commands+args you don't want to go away (SORTED!, 1 per line), like: /etc/bootpd -s -d /usr/foo/bar-o-matic -kludge /usr/lib/lpd ------------- John Hascall / john@iastate.edu / hascall@atanasoff.cs.iastate.edu