From: Herbert Xu Date: Sat, 18 Jun 2005 00:15:22 GMT Subject: Re: Handling merge conflicts a bit more gracefully.. Message-ID: In-Reply-To: Linus Torvalds wrote: > >> # Modified in both, but differently. >> + merge -p "$src1" "$orig" "$src2" > "$4" >> >> Again, make sure "$4" is not a directory before redirecting into >> it from merge, so that you can tell merge failures from it? > > Hmm.. What's the cleanest way to check for redirection errors, but still > be able to distinguish those cleanly from "merge" itself returning an > error? I don't know whether this is the cleanest, but this is one way: redir=failed { redir=ok merge -p "$src1" "$orig" "$src2" } > "$4" || err=$? if [ $redir = failed ]; then ... fi Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt