Re: Recomended tutoial(s) on doing arithmetic in Bash scripts
- Date: Sun, 5 Mar 2017 19:21:47 +0300
- From: Reco <recoverym4n@xxxxxxxxx>
- Subject: Re: Recomended tutoial(s) on doing arithmetic in Bash scripts
On Sun, 5 Mar 2017 09:42:16 -0600
Richard Owlett <rowlett@xxxxxxxxxxx> wrote:
> I'm interested in "expr" and "bc".
> The man pages lack reasonable examples.
> The tutorial/HOWTO pages confuse the issue with fancy page layouts
> and/or code samples showing how impressive the author can make the
> script's output.
expr 2 + 2
echo 2 + 2 | bc
and, since you mentioned bash - you don't need anything but bash to do
echo $((2 + 2))