Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!mailrus!tut.cis.ohio-state.edu!bloom-beacon!gatech!udel!rochester!PT.CS.CMU.EDU!cadre!pitt!darth!formtek!ditka!csanta!greg From: greg@csanta.UUCP (Greg Comeau) Newsgroups: comp.unix.xenix Subject: Re: shell problem Message-ID: <120@csanta.UUCP> Date: 5 Apr 88 04:52:11 GMT References: <1171@bc-cis.UUCP> Reply-To: greg@csanta.UUCP (Greg Comeau) Organization: Comeau Computing, Richmond Hill, NY Lines: 13 >An application I wrote in shell should accept a unix command >from a user and execute it. The solution should be: > read l > exec $l >My solution was; > read l > echo $l>tmp$$ > exec tmp$$ The ls -l should work, but the ls -l;who will not because the ';' is a shell construct that needs to be intepreted (that is, $l only results in a string, what you want to do is force the shell to scan the line again after substitutions). You can make this happen by using: eval $l (or eval exec $l)