From owner-freebsd-questions Tue Mar 9 12:56: 5 1999 Delivered-To: freebsd-questions@freebsd.org Received: from alpha.comkey.com.au (alpha.comkey.com.au [203.9.152.215]) by hub.freebsd.org (Postfix) with SMTP id 7A6391506A for ; Tue, 9 Mar 1999 12:55:53 -0800 (PST) (envelope-from gjb@comkey.com.au) Received: (qmail 14535 invoked by uid 1001); 9 Mar 1999 20:29:42 -0000 Message-ID: <19990309202942.14534.qmail@alpha.comkey.com.au> X-Posted-By: GBA-Post 1.04 06-Feb-1999 X-PGP-Fingerprint: 5A91 6942 8CEA 9DAB B95B C249 1CE1 493B 2B5A CE30 Date: Wed, 10 Mar 1999 06:29:42 +1000 From: Greg Black To: cjclark@home.com Cc: gjb@comkey.com.au (Greg Black), freebsd-questions@FreeBSD.ORG Subject: Re: sh Tutorial References: <199903091540.KAA00613@cc942873-a.ewndsr1.nj.home.com> In-reply-to: <199903091540.KAA00613@cc942873-a.ewndsr1.nj.home.com> of Tue, 09 Mar 1999 10:40:35 EST Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > > Anyone out there know of a good tutorial for the Bourne shell (sh)? In > > > particular, one with a focus on file descriptors. The few I find and > > > the manpage say that the following line opens 'temp' for reading and > > > writing and associates fd 3 with it, > > > > > > exec 3<> temp > > > > > > However, I get, > > > > > > ./fdtest: 3: Syntax error: redirection unexpected > > > > > > Whenever I use a '<>' redirect. What am I doing wrong? If I do either > > > a '>' or '<' it works. > > > > Seems like /bin/sh has a bug. It works fine with bash -- and > > bash comes with a decent man page and substantial additional > > documentation which is worth reading. > > Found the PR for it, bin/7325. It was reported for 2.2.6 in July of > last year. For some reason, the PR-sender listed is as 'non-critical' > and of 'low' priority. IMHO, the potential to break a sh-script that > should work according to the docs is a bit more severe than that. You could try to persuade the maintainers that it matters. It may be that people consider it low priority because they don't use this feature -- I have to say that, in about a million years of writing shell scripts, I've never even wanted to use the <> redirection facility ... In the meantime, if you do need <>, you can use bash. (I didn't take the time to see that it *works* in bash, but at least bash doesn't regard it as a syntax error the way sh does.) -- Greg Black To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message