[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Fix `set -o posix' again
From: |
Eric Blake |
Subject: |
Re: Fix `set -o posix' again |
Date: |
Sun, 12 Feb 2006 02:06:03 +0000 |
> Clever. Would it not be easier thus:
>
> case "`set -o 2>/dev/null`" in
> *"posix "* ) set -o posix ;;
> esac
The first "" are redundant, and you can't be sure whether a space or a
tab appears as the whitespace in the selection pattern. But how
likely are we to have a shell that has an option that has the substring
"posix", without also supporting the actual option "posix"? Why not:
case `set -o 2>/dev/null` in
*posix*) set -o posix ;;
esac
--
Eric Blake
- Re: Fix `set -o posix' again,
Eric Blake <=