0

I am suddenly seeing the following warning when I ssh to my server. I researched it and cannot seem to find the cause neither I am able to get rid of it.

Please, can someone help?

enter image description here

Thank you!

PtiSinge
  • 3
  • 1

2 Answers2

2

This warning is produced by the ps command when you use a syntax such as ps -aux. See this QA for a discussion on how to suppress this warning: Suppress warning from ps -aux on Linux

The reason for the warning message is straightforward. ps supports options of three types: POSIX style options with one dash (-e), BSD style options with no dash (a), and GNU-style options with two dashes (--forest). Mixing different types of options, specifically -aux and aux will produce this warning. This is described in the project's FAQ:

Why does "ps -aux" complain about a bogus '-'?

According to the POSIX and UNIX standards, the above command asks to display all processes with a TTY (generally the commands users are running) plus all processes owned by a user named "x". If that user doesn't exist, then ps will assume you really meant "ps aux". The warning is given to gently break you of a habit that will cause you trouble if a user named "x" were created.

Since you're seeing this on login, the offending ps command is likely inside your login profile (~/.bash_profile for the bash shell).

Haxiel
  • 8,201
  • 1
  • 20
  • 30
  • Looking further into this, it seems it's the following line in the bash_profile that's causing it. `eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)` The problem is, if I delete or comment the line, I can no longer use the `brew` command. Does anyone know how to solve this? – PtiSinge Aug 26 '21 at 12:22
  • @PtiSinge I'm not familiar enough with brew, so I might be wrong here. But based on the manpage, `brew shellenv` should just print out a bunch of `export` statements. Coupled with `eval`, that's a way to add a set of variables to the shell environment (which are probably required by brew). I don't see how this can cause a problem with `ps`. – Haxiel Aug 26 '21 at 13:01
  • @PtiSinge The `.bash_profile` file was the most obvious place to contain the `ps` command, but there are a few other possibilities you can check. See this QA for details: https://unix.stackexchange.com/a/117470/173368 – Haxiel Aug 26 '21 at 13:02
  • The thing is, if I comment the line in the `.bash_profile` and source it. The warning disappears. Just I can't use the Homebrew `brew` command now. :-( – PtiSinge Aug 26 '21 at 13:04
0

The error is related to Homebrew, specifically this line. Your ps use the c flag instead -c.

The eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv) instruction evaluates which SHELL you are using to export the proper format regarding PATH variables:

When I got this error I define manually the brew variables in my ~/.bashrc:

export HOMEBREW_PREFIX=${HOMEBREW_PREFIX};
export HOMEBREW_CELLAR=${HOMEBREW_CELLAR};
export HOMEBREW_REPOSITORY=${HOMEBREW_REPOSITORY}
export HOMEBREW_SHELLENV_PREFIX=${HOMEBREW_PREFIX}
export PATH=${HOMEBREW_PREFIX}/bin:${HOMEBREW_PREFIX}/sbin${PATH+:$PATH}
export MANPATH="${HOMEBREW_PREFIX}/share/man${MANPATH+:$MANPATH}:"
export INFOPATH="${HOMEBREW_PREFIX}/share/info:${INFOPATH:-}"
zorbax
  • 330
  • 1
  • 2
  • 12