🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.shell
Article #1739

Re: Using imbedded commands inside expr(1)

#1739
From: Paul Chamberlain
Date: Fri, 09 Nov 1990 16:44
16 lines
1125 bytes
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
Technical Details
Message-ID: <4181@awdprime.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!romp!auschs!awdprime!doorstop.austin.ibm.com!tif
References: <1462@eastman.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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