Re: Recomended tutoial(s) on doing arithmetic in Bash scripts

2017-03-06 Thread tomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Mon, Mar 06, 2017 at 03:50:06PM +0100, Jörg-Volker Peetz wrote: > Greg Wooledge wrote on 03/06/17 14:38: > > On Sun, Mar 05, 2017 at 05:25:49PM +0100, to...@tuxteam.de wrote: > >> If you need floating point numbers, bc (or dc) are your next stops. >

Re: Recomended tutoial(s) on doing arithmetic in Bash scripts

2017-03-06 Thread Jörg-Volker Peetz
Greg Wooledge wrote on 03/06/17 14:38: > On Sun, Mar 05, 2017 at 05:25:49PM +0100, to...@tuxteam.de wrote: >> If you need floating point numbers, bc (or dc) are your next stops. > > Or awk. For some problems, awk is fantastic. > Yes, it helps to sample the number of "bytes" like so: owl1=$(awk

Re: Recomended tutoial(s) on doing arithmetic in Bash scripts

2017-03-06 Thread tomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Mon, Mar 06, 2017 at 08:38:05AM -0500, Greg Wooledge wrote: > On Sun, Mar 05, 2017 at 05:25:49PM +0100, to...@tuxteam.de wrote: > > If you need floating point numbers, bc (or dc) are your next stops. > > Or awk. For some problems, awk is fantastic

Re: Recomended tutoial(s) on doing arithmetic in Bash scripts

2017-03-06 Thread Greg Wooledge
On Sun, Mar 05, 2017 at 05:25:49PM +0100, to...@tuxteam.de wrote: > If you need floating point numbers, bc (or dc) are your next stops. Or awk. For some problems, awk is fantastic. On Sun, Mar 05, 2017 at 06:14:00PM +, GiaThnYgeia wrote: > I see your 2 and raise you > nosuchagency@bottomoft

Re: Recomended tutoial(s) on doing arithmetic in Bash scripts

2017-03-06 Thread tomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Mon, Mar 06, 2017 at 05:13:36AM -0600, Richard Owlett wrote: > On 03/05/2017 04:12 PM, Jude DaShiell wrote: > >Another external tool at least as good as bc is wcalc and once that > >package gets installed just run wcalc at the command prompt and you

Re: Recomended tutoial(s) on doing arithmetic in Bash scripts

2017-03-06 Thread Richard Owlett
On 03/05/2017 04:12 PM, Jude DaShiell wrote: Another external tool at least as good as bc is wcalc and once that package gets installed just run wcalc at the command prompt and you'll have quite a load of examples show up. For my current project I think dc, rather than expr or bc, is the bette

Re: Recomended tutoial(s) on doing arithmetic in Bash scripts

2017-03-05 Thread David Christensen
On 03/05/2017 12:41 PM, Richard Owlett wrote: On 03/05/2017 01:48 PM, David Christensen wrote: On 03/05/2017 07:42 AM, Richard Owlett 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

Re: Recomended tutoial(s) on doing arithmetic in Bash scripts

2017-03-05 Thread Jude DaShiell
-user@lists.debian.org Subject: Re: Recomended tutoial(s) on doing arithmetic in Bash scripts Resent-Date: Sun, 5 Mar 2017 16:26:04 + (UTC) Resent-From: debian-user@lists.debian.org -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Sun, Mar 05, 2017 at 09:42:16AM -0600, Richard Owlett wrote:

Re: Recomended tutoial(s) on doing arithmetic in Bash scripts

2017-03-05 Thread Jude DaShiell
ope this helps. On Sun, 5 Mar 2017, Richard Owlett wrote: Date: Sun, 5 Mar 2017 10:42:16 From: Richard Owlett To: debian-user Subject: Recomended tutoial(s) on doing arithmetic in Bash scripts Resent-Date: Sun, 5 Mar 2017 15:43:08 + (UTC) Resent-From: debian-user@lists.debian.org I'

Re: Recomended tutoial(s) on doing arithmetic in Bash scripts

2017-03-05 Thread tomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Sun, Mar 05, 2017 at 11:48:47AM -0800, David Christensen wrote: > On 03/05/2017 07:42 AM, Richard Owlett wrote: > >I'm interested in "expr" and "bc". > >The man pages lack reasonable examples. > >The tutorial/HOWTO pages confuse the issue with fancy

Re: Recomended tutoial(s) on doing arithmetic in Bash scripts

2017-03-05 Thread Richard Owlett
On 03/05/2017 02:23 PM, to...@tuxteam.de wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Sun, Mar 05, 2017 at 12:10:43PM -0600, Richard Owlett wrote: [...] How about the whole app You solved my problem with one line. Glad it helped :) [...] I needed to report the number of bytes

Re: Recomended tutoial(s) on doing arithmetic in Bash scripts

2017-03-05 Thread Richard Owlett
On 03/05/2017 01:48 PM, David Christensen wrote: On 03/05/2017 07:42 AM, Richard Owlett 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 m

Re: Recomended tutoial(s) on doing arithmetic in Bash scripts

2017-03-05 Thread tomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Sun, Mar 05, 2017 at 06:14:00PM +, GiaThnYgeia wrote: > It is Sunday and I don't like Mondays > tell me why > > to...@tuxteam.de: > > Hm. Neither expr nor bc are bash, they are "external" binaries. If you > > want to do arithmetic in bash, ther

Re: Recomended tutoial(s) on doing arithmetic in Bash scripts

2017-03-05 Thread tomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Sun, Mar 05, 2017 at 12:10:43PM -0600, Richard Owlett wrote: [...] > How about the whole app > You solved my problem with one line. Glad it helped :) [...] > I needed to report the number of bytes downloaded for each portion > of a project [..

Re: Recomended tutoial(s) on doing arithmetic in Bash scripts

2017-03-05 Thread David Christensen
On 03/05/2017 07:42 AM, Richard Owlett 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. Suggestions please. ht

Re: Recomended tutoial(s) on doing arithmetic in Bash scripts

2017-03-05 Thread Richard Owlett
On 03/05/2017 12:10 PM, Richard Owlett wrote: On 03/05/2017 10:25 AM, to...@tuxteam.de wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Sun, Mar 05, 2017 at 09:42:16AM -0600, Richard Owlett wrote: I'm interested in "expr" and "bc". The man pages lack reasonable examples. The tutorial/HO

Re: Recomended tutoial(s) on doing arithmetic in Bash scripts

2017-03-05 Thread GiaThnYgeia
It is Sunday and I don't like Mondays tell me why to...@tuxteam.de: > Hm. Neither expr nor bc are bash, they are "external" binaries. If you > want to do arithmetic in bash, there's $((...)): > > tomas@rasputin:~$ echo $(( (3+4)/3 )) > 2 I see your 2 and raise you nosuchagency@bottomofthesea

Re: Recomended tutoial(s) on doing arithmetic in Bash scripts

2017-03-05 Thread Richard Owlett
On 03/05/2017 10:25 AM, to...@tuxteam.de wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Sun, Mar 05, 2017 at 09:42:16AM -0600, Richard Owlett wrote: I'm interested in "expr" and "bc". The man pages lack reasonable examples. The tutorial/HOWTO pages confuse the issue with fancy page lay

Re: Recomended tutoial(s) on doing arithmetic in Bash scripts

2017-03-05 Thread tomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Sun, Mar 05, 2017 at 09:42:16AM -0600, Richard Owlett 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 impres

Re: Recomended tutoial(s) on doing arithmetic in Bash scripts

2017-03-05 Thread Reco
Hi. On Sun, 5 Mar 2017 09:42:16 -0600 Richard Owlett 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'

Recomended tutoial(s) on doing arithmetic in Bash scripts

2017-03-05 Thread Richard Owlett
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. Suggestions please. TIA