[NCLUG] /etc/environment

Bob Proulx bob at proulx.com
Sun Aug 19 13:14:37 MDT 2007


John L. Bass wrote:
> the original intent was so that:
> 
> 	a=`eval $a + 1`
> 
> would allow math in scripts to work, but it's useful for a lot more.

You meant 'expr' in the above, right?

  a=`expr $a + 1`

:-)

Note that in today's modern shells I would recommend doing math
directly in $((...)) expressions.  It is POSIX standard and all
standard shells support it.

  a=$(( $a + 1 ))

[This does not apply to /etc/environment though.]

Bob



More information about the NCLUG mailing list