I am pretty new to OSX but everything is almost settled down, I had configured Z and ZSH earlier and lately come to know about paulirish dot files from https://github.com/paulirish/dotfiles and installed it.
Got to see following output when I refresh .bash_profile or .bashrc
Last login: Tue May 14 08:41:35 on console
ls
➜ ~ ls
Applications Downloads Music Samsung dotfiles log
Desktop Library Pictures Sites install-deps.sh readme.md
Documents Movies Public bin js-boilerplate
➜ ~ z
zsh: command not found: z
➜ ~ source ~/.bash_profile
/Users/marif/.aliases:79: bad option: -t
/Users/marif/.aliases:82: bad option: -t
/Users/marif/.functions:37: parse error near `]]'
/Users/marif/.bash_profile:.:9: no such file or directory: /Users/marif/code/z/z.sh
/Users/marif/.bash_profile:15: command not found: shopt
/Users/marif/.bash_profile:26: command not found: complete
\[\e]2;/Users/marif\[\a\]\[\e]1;\]Users/\W\[\a\]marif at \[\]\w\[\]\[\]\[\]\n$ \[\]
I don't know what's going wrong here, would help if somebody point me out to issue persisting in my profile or something.
zsh is not bash and when I launch "zsh", I see the same error that you do:
[/tmp]:;zsh
ElvisIsAliveAndWell-2% type -t
zsh: bad option: -t
These paulirish dot files are meant to be used with bash. Either use bash or you'll need to port the lines in the dot files that are throwing errors so that they will work in zsh (and if you do this, you can fork or branch or suggest changes to PaulIrish so he can pick up these changes and make them available for other interested folks).
Related
edit : I ended up upgrading to macOS Catalina yesterday and replacing bash with zsh. One thing that should be noted is that the stackcommand worked previously, but despite all the tinkering not ghci
After deleting all the files that had anything to do with Haskell, I retried running curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
This second time there was an error with the command line tools so I had to install them manually with xcode-select --install. After rerunning the curl, I added the path to the environmental file to my zsh profile manually with :
. "$HOME/.ghcup/env"\
echo '. $HOME/.ghcup/env' >> "$HOME/.zshrc"
Here is the content of the env file :export PATH="$HOME/.cabal/bin:/Users/agnel/.ghcup/bin:$PATH"
Now everything seems to be working (I never reinstalled stack, but I think I might leave that to the side while I learn the basics of the language).
I installed the Haskell Platform yesterday but am having a hard time getting it to work correctly.
The firsts steps I did are:
curl -sSL https://get.haskellstack.org/ | sh
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
On step 1. the instructions said to append /Users/.../.local/bin the PATH variable (which I did in /etc/paths. On step 2, the script was supposed to pop up a dialog box (and didn't) when installing the necessary command line tools. It also said to rerun the script once complete (which I did). The script also said I should adjust my PATH variable, and source /Users/.../.ghcup/env in my shell configuration. It asked to this automatically but failed having not found the ~/.bashrc File. (I read that on Mac in contrary to linux, only .bash_profile is loaded upon opening of a terminal window so I adjusted the path variable there manually. I've spent forever messing around with the path variables and every time I try and run "$ ghci" I get the same -bash: ghci: command not found error message. If anyone has a solution to this problem I would be very grateful for an answer. If not, could someone with a working distribution of Haskell on their computer show me what their path variables look like?
Thanks!
A simple solution would just be to restart your terminal and you are good to go.
After installing the Haskell platform for the first time on a new mac with Catalina, I also got
~> ghci
zsh: command not found: ghci
What worked in my case was to use, instead of the plain ghci,
stack ghci
To get back the familiar behaviour, I created in my homedirectory a file named .zshrc containing
alias ghci='stack ghci'
If you open a new terminal, this file will automatically be executed.
I'd be interested to know if there is another solution.
Check if the ghcup command is working or not.
If not, make sure the .zshrc file has command for execution of ghcup. It should look something like this -
[ -f "/Users/myusername/.ghcup/env" ] && source "/Users/myusername/.ghcup/env" # ghcup-env
If the file exists, simply restarting terminal will work.
If it is still not working, set GHC as default using ghcup - follow this
I'm installing harbor with source code.
✗ make install
the error is below:
...
Successfully built b917c04731a3
Successfully tagged goharbor/nginx-photon:dev
Done.
/bin/bash: --timeout: command not found
make[1]: *** [_build_registry] Error 127
make: *** [build] Error 2
I've tried to get coreutils and config my path
brew install coreutils
Edit :
The answer of #Arne Vogel is more likely to point the real problem.
Indeed it would be surprising that you don't have the command /bin/bash (so the steps I described here won't solve the issue).
coresutil is composed of GNU version of the most famous commands (cat, head, tail, wc, sort...), so it's not directly related to your problem.
You can use brew to install the latest version (version 5) of bash:
brew install bash
Double check if you really don't have a bash inside your /bin/:
sudo ls /bin/bash
It should returns a line like this (pay attention to the permission):
-r-xr-xr-x 1 root wheel 618416 Nov 30 12:55 /bin/bash
If it returns no result, then you may create a link:
sudo ln -s $(which bash) /bin/bash
TBH, I don't know about harbor, but this error seems to be caused by bad formatting in a script, specifically something like:
some-command --some-option --some-other-option \
--timeout
Now if the backslash (to continue the line) is missing, some-command will first be executed (without the --timeout option), and then bash will try to execute a command called --timeout, which, unsurprisingly, does not exist.
This problem can also be caused by an extraneous space after the backslash, a stray semicolon, wrong line terminators (in particular, Windows-style CRLF) etc.
Here are some suggestions for what you could do:
Make sure you have downloaded the source package appropriate for Mac OS X. Many open source packages are distributed in different formats, e.g. .zip and/or .7z for Windows, .tar.gz and/or .tar.bz2 for UNIX. You need either of the latter.
Check the documentation and/or forums, obviously.
If that doesn't help, use ktrace to find the offending script, and then look at it in a text editor. If you do find a bug in a script, consider reporting it to the developers.
I am trying to use CocoaPods with my Xcode project -- Study Hall -- but when I try to locate the project on my desktop I get an error.
I have done the following,
$ ls
$ cd Desktop
$ ls
$ cd Study Hall
I expected for the Xcode project to come up on the Terminal but instead it gives me the error:
-bash: cd: Study: No such file or directory.
Why is this happening and how can I get it to function properly? This is actually my first time installing CocoaPods and using the Terminal so it is really confusing for me.
Try this:
$ cd Study\ Hall
You probably forgot to escape the space in the middle. Otherwise the terminal does not know if this should be treated as two parameters (Study + Hall) divided with a space or one parameter ("Study Hall") where the space is part of the name
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.
I'm trying to run this script on Mac OS 10.7 (Lion) and I'm getting the error:
$ bbcolors
-bash: /usr/local/bin/bbcolors: /usr/bin/env: bad interpreter: Operation not permitted
I've successfully run this script on other Macs of mine. It's just this script downloaded and unmodified from Daring Fireball.
I found this person with a very similar problem but the accepted answer was that the filesystem had a 'noexe' option on mount. I'm pretty sure that's not the case for me because I've just got it in /usr/local/bin/ and other stuff in there works fine (it also doesn't run from other places or as other users including root).
$ which bbcolors
/usr/local/bin/bbcolors
$ ls -l /usr/local/bin/bbcolors
-rwxr-xr-x# 1 nick staff 9751 Mar 30 19:09 /usr/local/bin/bbcolors
It's a Perl script not a compiled binary, not that that should matter. Here's some extra info for what it's worth:
$ cat /usr/local/bin/bbcolors |head -n 1
#!/usr/bin/env perl
$ which perl
/usr/bin/perl
$ env | grep PATH
PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
Did you happen to open/save the file in TextEdit?
That can introduce filesystem metadata (quarantine attribute) leading to the symptom you describe.
Try:
xattr -l /usr/local/bin/bbcolors
and
xattr -d com.apple.quarantine /usr/local/bin/bbcolors
if you see the quarantine attribute.
pilcrow's answer is correct, however I draw your attention to the fact that if you are working with a disk image, the problem can be very confusing, as the com.apple.quarantine attribute seems to be inherited from the disk image file to the files inside (thanks to febeling at Apple dev forums for noticing that!).
To solve the problem, you have to remove the quarantine attribute from the disk image:
xattr -d com.apple.quarantine /path/to/disk/image
and then eject and remount the disk image. Then your files will be clean again.
I had resolved this issue.Open the command file with TextEdit then save it.
More Info:Resolved Operation not permitted
-bash: /usr/local/bin/bbcolors: /usr/bin/env: bad interpreter: Operation not permitted
Does /usr/bin/env exist? Can you run it? Run by itself it should dump your environment variables to stdout.
You can safely replace:
#!/usr/bin/env perl
With the full path to your perl binary of choice, e.g:
#!/usr/bin/perl
I ran into this after creating a shell script in BBEdit (CLI: bbedit ~/bin/foo). It seems that the macOS sandbox security feature automatically quarantines files modified by BBEdit — if the file is executable and is accessed by BBEdit in a certain way.
The fix is easy: Preferences > Application > Allow
https://www.barebones.com/support/bbedit/quarantine.html
1.delete "node_modules" folder
2.npm install