[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Determing if pipe exists

From: Russell Van Tassell
Subject: Re: Determing if pipe exists
Date: Thu, 5 May 2005 15:22:43 -0700
User-agent: Mutt/1.4.1i

On Wed, May 04, 2005 at 02:24:50PM -0500, Brendan Strejcek wrote:
> This is what I would do:
>     classes:
>         is_pipe = (
>             ReturnsZero(/bin/sh -c '
>                 /bin/ls -l /path/to/pipe | /bin/grep ^p >/dev/null 2>&1
>             ')
>         )

What about something like...

         is_pipe = (
             ReturnsZero(/bin/sh -c '
                 /bin/test -p /path/to/pipe

...perhaps a bit cleaner.

Russell M. Van Tassell

"There are not so many lessons in glad times.  Adversity is by far the
 better teacher.  Adversity will be part of almost all our lives.  So it
 is not in escaping adversity, but in answering it, that our character
 is defined."                                      -- Christopher Warren

reply via email to

[Prev in Thread] Current Thread [Next in Thread]