Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!ncar!husc6!ukma!usenet.ins.cwru.edu!news From: news@usenet.ins.cwru.edu Newsgroups: comp.unix.shell Subject: Re: Using imbedded commands inside expr(1) Message-ID: <1990Nov9.145433.4677@usenet.ins.cwru.edu> Date: 9 Nov 90 14:54:33 GMT References: <1462@eastman.UUCP> Reply-To: chet@po.CWRU.Edu Organization: Case Western Reserve Univ. Cleveland, Ohio, (USA) Lines: 20 Nntp-Posting-Host: thor.ins.cwru.edu In article <1462@eastman.UUCP> gerwitz@kodak.com (Paul Gerwitz) writes: >I seem to be having trouble using expr. The following dies: > > test=`expr `tail +3 file` + 1` Since you're using ksh, how about: test=$(expr $(tail +3 file) + 1) If you want backwards compatibility with sh, use this: test=`expr \`tail +3 file\` + 1` Chet -- Chet Ramey Network Services Group ``I die, Horatio'' Case Western Reserve University chet@ins.CWRU.Edu