Using imbedded commands inside expr(1)

Tom Christiansen tchrist at convex.COM
Thu Nov 8 14:38:25 AEST 1990


In article <1462 at eastman.UUCP> gerwitz at kodak.com (Paul Gerwitz) writes:
>I seem to be having trouble using expr [in ksh].  The following dies:
>
>    test=`expr `tail +3 file` + 1` 

Write it this way:

    test=$(expr $(tail +3 file) + 1)

--tom



More information about the Comp.unix.shell mailing list