Skip to content

Fix : binary operator expected and don't use a not not operator#276

Merged
dgibbs64 merged 7 commits intoGameServerManagers:masterfrom
Poil:master
Jan 26, 2015
Merged

Fix : binary operator expected and don't use a not not operator#276
dgibbs64 merged 7 commits intoGameServerManagers:masterfrom
Poil:master

Conversation

@Poil
Copy link
Copy Markdown
Contributor

@Poil Poil commented Jan 25, 2015

No description provided.

@Poil
Copy link
Copy Markdown
Contributor Author

Poil commented Jan 25, 2015

Update: True selfname. Remove stupid code

@dgibbs64
Copy link
Copy Markdown
Member

Thanks for the code updates. Looks like you know best practices better than me. I welcome any code that improves or optimises the scripts. I will review your code and do a merge very soon. Thanks for submitting this.

@Poil
Copy link
Copy Markdown
Contributor Author

Poil commented Jan 26, 2015

Hi, perhaps we can also move all "Directories, Logging, fn_runfunction" section from script to a common shared configuration file and just source this file.

@Poil
Copy link
Copy Markdown
Contributor Author

Poil commented Jan 26, 2015

Also you have some duplicate code (ex: fn_distro, fn_distro_detail)
You can use "/proc/loadavg" and "/proc/meminfo" to replace uptime/free command with a simple awk

And for the best practices, In Bash either you use simple bracket syntax and you protect your variable with double quotes or you use the double bracket syntax

[ -z "${foo}" ]
#or
[[ -z ${foo} ]]
#or ...
[[ -z "${foo}" ]]

You can have more syntax improvment on Bash hackers wiki http://wiki.bash-hackers.org/start
Note, you can replace all your if or syntax : http://wiki.bash-hackers.org/syntax/ccmd/conditional_expression

And also another very good bash information website : http://mywiki.wooledge.org/BashFAQ

@dgibbs64
Copy link
Copy Markdown
Member

I don't quite follow. fn_runfunctions is required to get all other functions. I'm not sure of a way to move the function out of the main file.

dgibbs64 added a commit that referenced this pull request Jan 26, 2015
Fix : binary operator expected and don't use a not not operator
@dgibbs64 dgibbs64 merged commit 74e89b2 into GameServerManagers:master Jan 26, 2015
@lock
Copy link
Copy Markdown

lock Bot commented Jul 19, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock Bot locked as resolved and limited conversation to collaborators Jul 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants