Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!pt.cs.cmu.edu!rochester!rit!tropix!moscom!ur-valhalla!uhura.cc.rochester.edu!sunybcs!rutgers!gatech!purdue!decwrl!decvax!ima!cfisun!lakart!dg From: dg@lakart.UUCP (David Goodenough) Newsgroups: comp.unix.questions Subject: Re: Why doesn't this work ? Message-ID: <579@lakart.UUCP> Date: 22 Jul 89 14:41:57 GMT References: <443@fdmetd.uucp> Organization: Lakart Corporation, Newton, MA Lines: 21 jon@fdmetd.uucp (Jon Ivar Tr|stheim) sez: > Why does not the following command work in a Bourne shell script ? > > USERID=`expr "`id`" : 'uid=\([0-9]*\)(.*'` > > The shell does not feed the whole argument list to 'expr(1)', so I get > the following error message: > > sh: : 'uid=\([0-9]*\)(.*': execute permission denied Possibly because `` constructs don't nest, at least not any way I've tried. Try this: STUG=`id` USERID=`expr "$STUG" : 'uid=\([0-9]*\)(.*'` -- dg@lakart.UUCP - David Goodenough +---+ IHS | +-+-+ ....... !harvard!xait!lakart!dg +-+-+ | AKA: dg%lakart.uucp@xait.xerox.com +---+