On Sun, Mar 08, 2009 at 08:50:25PM +0100, Michael Wagner wrote:

> -----------------------------------------------------+
> #! /bin/bash                                         |
>                                                      |
> if [ $(pgrep -x script.sh) ]; then <script here>; fi |

Again: if runs a command as a test. Using '[' (test) is not a
requirement.

if pgrep -x script.sh >/dev/null; then ...

(The above would also be a syntax error if you get two matches)

-- 
Tzafrir Cohen         | [email protected] | VIM is
http://tzafrir.org.il |                    | a Mutt's
[email protected] |                    |  best
ICQ# 16849754         |                    | friend


-- 
To UNSUBSCRIBE, email to [email protected] 
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to