Can you educate me a bit and explain what that command would do? Thanks
First, PATH is a shell variable. It contains a list of directories to look in for commands.
Second, 'echo' is a bash builtin command, i.e. it doesn't have to exist in any directory. So the 'echo $PATH' means "show the list of directories where bash is looking for commands".
All the earlier posted error messages indicate that bash is unable to find the command that was entered. Example message:
-bash: scutil: command not found
Note the message is from bash (the '-bash:' part), and bash is telling you the command isn't found. It's not that 'scutil' is running and failing, it's that bash can't find an 'scutil' to run. The simplest explanation for this is that PATH is empty or contains a list of unusable directories.
The $PATH is quoted because if it contains oddball stuff, I don't want it to be interpreted.
The next part shows PS1, which is bash's prompt string 1. I put in a literal 'PS1:' in the 2nd quoted string, to separate it from the $PATH.
PS1 is a special string, which by default contains meta characters that will display the hostname, username, etc. However, PS1 can also contain literal characters, which are simply emitted as the prompt. For example, try this sequence of commands in a Terminal window:
Code:
save_PS1="$PS1"
PS1="mwa-ha-ha \\u \$"
The first line saves the current value of PS1. The 2nd line sets PS1 to a different prompt. You'll see what happens (nothing horrible, I promise).
You can restore the original PS1 with this command:
What I suspect has happened is that whatever has set PATH to some useless value has also set PS1 to a string containing the literal text "hhahahaahahahahahah". The "shadow" part of the prompt might be a literal, or it could be the username, considering the MR id this user signed up as.
So by asking to see the value of PS1, I'm trying to see if the "hhahahaahahahahahah" is in PS1, or whether the hostname might have actually been changed.
I suspect the underlying cause of all this mayhem is that one of the bash profile files in the user's home dir is damaged or corrupted, possibly intentionally by whatever command was actually run.
Looking at bash profiles is where I'll go next, once I find out what PATH is (and correct it), and what PS1 is (and correct it).