I recently updated some applications and now it is giving me error when I open any new tab in teminal.
Error it is giving:
/Users/priti/.oh-my-zsh/lib/completion.zsh:28: command not found:
whoami /Users/priti/.oh-my-zsh/lib/theme-and-appearance.zsh:10:
command not found: uname
/Users/priti/.oh-my-zsh/lib/theme-and-appearance.zsh:14: command not
found: uname getent:4: command not found: grep
I am sure something is wrong with the updated zshrc file, but I am not able to figure out what exactly the problem in that.
Problems I have faced till now are vi and grepcommand not working.For both output is command not found.
Thanks in advance for the same.
Reinstalling zsh solved the problem.
Some steps I followed after brew update might have caused this problem.
Related
Chances are that you might be getting the following error on your Mac, when you have been trying to run commands in the terminal
and you have already installed the commands
zsh: command not found: git
or
zsh: command not found: curl
The fix is in the answer below
Chances are that something might have gone wrong with the users $PATH on your machine or maybe the actual path where the command is has not been set.
You can just run the command below, this should fix you issue:
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
and if you feel like checking the path you can just run :
echo $PATH
for some reason whenever I open my terminal it immediately prints the following (after the "last login" line of course):
(eval):116: command not found: dirname
(eval):116: command not found: dirname
__add_sys_prefix_to_path:6: command not found: dirname
__add_sys_prefix_to_path:7: command not found: dirname
It appears that terminal still works fine, but I can't seem to figure out what the cause of these errors could be. The only thing I've "changed" in my terminal last time I used it was setting up a conda environment and installing some new packages.
Any ideas?
You have tampered with the PATH variable and your current PATH cannot figure out where your common utilities are located.
try:
PATH=/bin:/usr/bin:/usr/local/bin:${PATH}
export PATH
Fix the last entry you made in your bash_profile or zshrc file before you started encountering the error.
I try executing the below commands in my terminal.
$ source ~/.bash_profile or . ~/.bash_profile
and the system returns:
-bash: [[-s: command not found
I cannot think of anything extra information to provide.
I kept researching my issue and came across this stackoverflow post
I initially misunderstood the error message to mean the source command was not found. After reading the other post I tried running bash .bash_profile and the result was .bash_profile: line 11: [[-s: command not found. I had an error in my .bash_profile file. I commented out the line and tried running source .bash_profile and it worked.
The initial command not found did not relate to the source command, it related to the file I was running with source.
I hope this helps someone else.
I was following this tutorial to try and be able to open Sublime text from terminal but I messed up along the way and now I keep getting this error in terminal:
parse_git_dirty:11: command not found: tail
I can't even seem to run this command:
open ~/.bash_profile
Which returns this:
zsh: command not found: open
parse_git_dirty:11: command not found: tail
I figured out what I messed up.
In following the tutorial, I embarrassingly added
export PATH=/usr/local/bin:(...)
including the ... and saved the file. I didn't realize it would mess everything up. I was able to figure out where bash_profile is saved and edit the file manually.
Whenever I start up Terminal on my Macbook Air, I get this message:
-bash: ≈: command not found
How do I fix this error? I'm running Mavericks version 10.9.4 if that helps at all.
EDIT: Fixed this error by using the bash -x method, found out it was a random '≈' character left in ~/.profile that needed to be deleted. Thanks for the answers :)
To debug you can try this:
bash -x -l
(the -l might not be needed).
I definitely agree with Barmar, there is something in your bash startup scripts.
There is not a great way to do this, but here is the protocol to remedy it.
Confirm it is your bash profile by first killing the process with a control + C if it is hung. Then do a source ~/.bash_profile and see if you get that same error.
Backup your bash profile cp ~/.bash_profile bashprofile.txt
Then comment out part of your bash profile. With text wrangler you can do a command + slash.
Save, then do a source ~/.bash_profile and see if the error still prints.
Repeat with different areas of the script until you have isolated the infected region.