Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Syntax error: invalid arithmetic operator #4

Open
sgtnasty opened this issue Oct 17, 2018 · 12 comments
Open

Syntax error: invalid arithmetic operator #4

sgtnasty opened this issue Oct 17, 2018 · 12 comments

Comments

@sgtnasty
Copy link

When running the last line shows:

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

@dylanaraps
Copy link
Owner

Try the latest commit.

@dylanaraps
Copy link
Owner

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

@sgtnasty
Copy link
Author

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)

@dylanaraps
Copy link
Owner

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

@sgtnasty
Copy link
Author

See attached

out.txt

@dylanaraps
Copy link
Owner

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
Copy link
Owner

Also, what terminal emulator are you using?

@sgtnasty
Copy link
Author

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

@dylanaraps
Copy link
Owner

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

@sgtnasty
Copy link
Author

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

@sgtnasty
Copy link
Author

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.

@g4570n
Copy link

g4570n commented Apr 2, 2020

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)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants