Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!romp!auschs!awdprime!doorstop.austin.ibm.com!tif From: tif@doorstop.austin.ibm.com (Paul Chamberlain) Newsgroups: comp.unix.shell Subject: Re: Using imbedded commands inside expr(1) Message-ID: <4181@awdprime.UUCP> Date: 9 Nov 90 16:44:34 GMT References: <1462@eastman.UUCP> Sender: news@awdprime.UUCP Reply-To: tif@doorstop.austin.ibm.com (Paul Chamberlain) Organization: IBM AWD, Austin, TX Lines: 16 Summary: Expires: Sender: Followup-To: Keywords: In article <1462@eastman.UUCP> gerwitz@kodak.com (Paul Gerwitz) writes: > test=`expr `tail +3 file` + 1` This works on my /bin/sh and my /bin/ksh: echo `expr \`expr 5 + 1\` + 3` In fact so does this: echo `expr \`expr \\\`expr 2 + 3\\\` + 1\` + 3` I didn't try it with tail or assigning it to a variable but it better work just as well (I'm assuming that you have a 3 line file, personally I'd use "tail -1" instead). Anybody know why the same thing fails on csh? Paul Chamberlain | I do NOT represent IBM. tif@doorstop, sc30661 at ausvm6 512/838-7008 | ...!cs.utexas.edu!ibmchs!auschs!doorstop.austin.ibm.com!tif