torque icon indicating copy to clipboard operation
torque copied to clipboard

Syntax error: invalid arithmetic operator

Open sgtnasty opened this issue 6 years ago • 12 comments

When running the last line shows:

./torque: line 38: �@4: 3.01: syntax error: invalid arithmetic operator (error token is ".01")1")

sgtnasty avatar Oct 17 '18 21:10 sgtnasty

Try the latest commit.

dylanaraps avatar Oct 17 '18 21:10 dylanaraps

If it's still broken, send me the output of transmission-remote -l (redact the torrent names if need be).

dylanaraps avatar Oct 17 '18 21:10 dylanaraps

Just pulled the latest and tested; still get:

./torque: line 38: �7�: 3.01: syntax error: invalid arithmetic operator (error token is ".01")

$ transmission-remote -l ID Done Have ETA Up Down Ratio Status Name 1 100% 1.53 GB Done 0.0 0.0 0.0 Idle Solus-3.9999-Budgie 2 100% 1.48 GB Done 58.0 0.0 6.1 Seeding elementaryos-5.0-stable.20181016.iso Sum: 3.01 GB 58.0 0.0 Running on: CentOS Linux release 7.5.1804 (Core)

sgtnasty avatar Oct 17 '18 22:10 sgtnasty

Can you do transmission-remote -l > file and send me the contents of file? The spaces were mangled when you copy/pasted.

dylanaraps avatar Oct 17 '18 22:10 dylanaraps

See attached

out.txt

sgtnasty avatar Oct 17 '18 22:10 sgtnasty

I can't reproduce this at all, using out.txt in place of transmission (faking the torrent listing).

What version of bash are you using? bash --version

dylanaraps avatar Oct 17 '18 23:10 dylanaraps

Also, what terminal emulator are you using?

dylanaraps avatar Oct 17 '18 23:10 dylanaraps

GNU bash, version 4.2.46(2)-release (x86_64-redhat-linux-gnu)

Using Gnome Terminal on Ubuntu 18.04 but I am ssh into the CentOS box

sgtnasty avatar Oct 18 '18 09:10 sgtnasty

It could be ssh causing the issue. Can you confirm that it works locally?

dylanaraps avatar Oct 18 '18 09:10 dylanaraps

I logged into the server, and still get the same message. Cant provide a screenshot cause its terminal, headless machine.

sgtnasty avatar Oct 18 '18 10:10 sgtnasty

The problem seems to be in the last line of transmission-remote -l output (the summary). Perhaps you need to skip that line in the parsing on torque: line 38?

$ transmission-remote -l
ID     Done       Have  ETA           Up    Down  Ratio  Status       Name
   1   100%    1.39 GB  Done         0.0     0.0    0.0  Stopped      CentOS-7-x86_64-LiveGNOME-1804
   2   100%    1.79 GB  Done         0.0     0.0    0.0  Stopped      Fedora-Workstation-Live-x86_64-28
   3   100%    2.00 GB  Done        14.0     0.0    1.4  Seeding      ubuntu-18.10-desktop-amd64.iso
   4   100%    1.53 GB  Done         0.0     0.0    0.0  Stopped      Solus-3.9999-Budgie
   5   100%    1.48 GB  Done         0.0     0.0    0.8  Seeding      elementaryos-5.0-stable.20181016.iso
   6   100%    2.10 GB  Done         0.0     0.0    0.0  Stopped      ubuntu-mate-18.10-desktop-amd64.iso
   7   100%   950.0 MB  Done         0.0     0.0    0.0  Stopped      CentOS-7-x86_64-Minimal-1804
   8   100%    1.51 GB  Done         0.0     0.0    0.0  Stopped      xubuntu-18.10-desktop-amd64.iso
   9   100%    1.94 GB  Done         0.0     0.0    0.0  Idle         linuxmint-19-cinnamon-64bit-v2.iso
  10   100%   559.7 MB  Done         0.0     0.0    0.0  Idle         manjaro-architect-17.1.12-stable-x86_64.iso
  11   100%    1.65 GB  Done         0.0     0.0    0.0  Idle         manjaro-i3-17.1.12-stable-x86_64.iso
Sum:          16.90 GB              14.0     0.0

The error specifically references parsing that sum of 16.90:

16.90: syntax error: invalid arithmetic operator (error token is ".90")

Its column spacing is different from the rest of the lines.

sgtnasty avatar Oct 22 '18 13:10 sgtnasty

I have a similar problem:

./torque: línea 25: syntax error near unexpected element `newline'
./torque: línea 25: `    for((i=${k:=0};i<(j=j>${#t[@]}?${#t[@]}:j);i++));{ t_print "${t[i]/n\/a/0}";}'
bash --version
GNU bash, versión 4.3.30(1)-release (x86_64-pc-linux-gnu)

g4570n avatar Apr 02 '20 14:04 g4570n