docs icon indicating copy to clipboard operation
docs copied to clipboard

Fix shell script in ulimit.txt

Open 48763 opened this issue 3 years ago • 0 comments

STAGING

Fix process_pids empty

Command ps -C $process -o pid --no-headers output prefix has 4 spaces on ubuntu 20.04 (older version had only 1 spaces), so the argument process_pids will empty in shell script.

Modify cut -d " " -f 2 to grep -oP "[[:digit:]]*", can solve this problem, and makes both versions compatible.

Fix operator expected

If using multiple arguments, will cause problem and shows following error message:

$ return-limits mongod mongos
-bash: [: mongod: binary operator expected
-bash: [: mongod: binary operator expected

The argument $@ should be changed to process_pids In the if conditional expressions, which can solve the problem and be more actual.

JIRA

Self-Review Checklist

  • [x] Is this free of any warnings or errors in the RST?
  • [x] Is this free of spelling errors?
  • [x] Is this free of grammatical errors?
  • [x] Is this free of staging / rendering issues?
  • [x] Are all the links working?

External Review Requirements

What's expected of an external reviewer?

48763 avatar Aug 15 '22 03:08 48763