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?
Thank you!
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?
Thank you!
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).
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?
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
.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
.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
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:-}"