On Sun, Mar 27, 2005 at 12:30:19AM +0100, Jonas Smedegaard wrote: > On 27-03-2005 00:13, Steve Langasek wrote: > > On Sat, Mar 26, 2005 at 11:43:07PM +0100, Jonas Smedegaard wrote:
> >>To keep the code compact I'd just append this to the grep lines: > >> || true if [ $? \< 2 ] > >>Do you see a problem with that? > > It's not POSIX sh syntax? > " true if " is actually a waste. The following is POSIXly correct, I beieve: > || [ $? \< 2 ] > or must it instead be this: > || test $? \< 2 Either [ or test is fine in POSIX sh, as they're required aliases. However, I don't think \< is a POSIX test operator -- I think you want -lt instead. > Where to find good info on POSIX sh syntax? AIUI the POSIX spec is available for download online, but I don't remember where. Otherwise, you could just test your scripts under dash as well as bash. -- Steve Langasek postmodern programmer
signature.asc
Description: Digital signature