Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rmate fails, when ls gives filesize containing , #65

Closed
NoNoNo opened this issue Dec 22, 2017 · 6 comments
Closed

rmate fails, when ls gives filesize containing , #65

NoNoNo opened this issue Dec 22, 2017 · 6 comments
Labels

Comments

@NoNoNo
Copy link

NoNoNo commented Dec 22, 2017

My version of ls is outdated (can’t do anything about that…):

$ ls --version
ls (GNU coreutils) 5.97

rmate in line 295 says:

filesize=`ls -lLn "$realpath" | awk '{print $5}'`

The result with my version of ls is for example 12,345. Then rmate fails by displaying only the N bytes of the number before the , – 12 in this example.

I fixed this by adding the following line after 295:

filesize=$(echo "$filesize" | sed 's/,//')
@aurora
Copy link
Owner

aurora commented Dec 29, 2017

Thanks for reporting this issue. I have to admit, that i didn't test this on older systems for quite a while now, even though it was the original intent to target older systems. Will delve into this issue next year ;).

@aurora
Copy link
Owner

aurora commented Jan 3, 2018

I am not sure, if this has something todo with the version of ls, at least i was not able to dig anything up regarding gnu ls and this kind of numeric formatting. The closest thing i found was someone who defined an alias for ls in the form of alias ls="ls --block-size=\'1" which leads to human readable output when using ls -l. Could you please enter the following in a shell of the system and tell me the output?

type ls

Thanks!

@NoNoNo
Copy link
Author

NoNoNo commented Jan 3, 2018

$ type ls
ls is an alias for ls --color=yes -F
ls is /bin/ls

@aurora
Copy link
Owner

aurora commented Jan 3, 2018

Ah ... so the alias i found was overcomplicated. Your alias does this as well, if you list a directory by executing /bin/ls -l directly, the output should be normal (non numeric formatting). Interesting. I wonder where this alias get's defined on your system, because normally rmate shouldn't pick this up. I have to think about what's the best way to solve this issue.

@aurora aurora added the bug label Jan 3, 2018
@aurora aurora closed this as completed in e259233 Jan 4, 2018
@aurora
Copy link
Owner

aurora commented Jan 4, 2018

This should work now on your system, can you try it and give feedback? Thanks!

@NoNoNo
Copy link
Author

NoNoNo commented Jan 23, 2018

Works! Thank you!

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

No branches or pull requests

2 participants