Why Can't My Xcode Project Folder Be Found in Terminal? - xcode

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

Related

-bash: ghci: command not found (Haskell interactive shell, Haskell installation )

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

-bash: ≈: command not found (OS X Terminal Error), How to Fix?

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.

OSX Touch Command -- Broken?

This feels like a silly question, but my touch command seems to have broken. Trying to create the ~/.bash_profile file using the command: touch ~/.bash_profile and seeing the following when I send the command: -bash: touch: No such file or directory. I've search quite a bit for an answer but haven't found the same problem so far. Can anyone assist? What exactly do I need to do in order to make the touch command work?
You might like to run the touch command through OS X's equivalent of strace (I think that command exists on OS X, actually, although there appear to be others), go through the output and examine what errors are generated, if any. Pasting the output to a pastebin may also be a good idea.
I think this is one of those instances where the call to strerror() inside touch's C code is referencing an insane value of errno. (This is where all those "Error performing <X>: Success" messages come from. There was an error, but errno subsequently got set to 0 by a successful command before errno was captured and the error message printed.)
I have OS X Mavericks, and I use Kornshell, but I'll switch over to bash:
Let's try touching a non-existent file:
$ touch foo
Nope. That worked. Let's try touching a file you don't own:
$ touch /usr/bin/true
touch true: Permission denied
Nope, that's what I expected and not what the OP got. Let's try with a symbolic link
ln -s foo bar
touch bar
Nope, worked. Let's try it with a directory:
$ touch Applications
Nope, also worked.
Try this:
$ sum /usr/bin/touch
6205 9 /usr/bin/touch
$ file /usr/bin/touch
/usr/bin/touch: Mach-O 64-bit executable x86_64
If you're using Mavericks, I assume you should get the same results.

dotfiles errors | /Users/marif/.aliases:79: bad option: -t

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).

How to get Terminal on OSX to start up clearly?

I am new to Mac OSX. Once after i typed export command in terminal, each time i start up the terminal, two messages show up:
-bash: export: '=': not a valid identifier
-bash: export: `:/Users/Li/File/Java/TStream': not a valid identifier
I know that clear and command+k can got a clean screen. But I just want to start up with a clean terminal.
Go to your terminal and type the
clear
command. This should clear your screen. Maybe what you're looking for is a way to have bash run that each time. If so, cd to your home directory:
cd ~
then edit the file called .bash_profile , or maybe .bashrc
On the last line write the word 'clear' without quotes, then save. This file runs when bash starts up, and the last thing it will do, therefore, is clear the screen.
For more info, checkout: this
EDIT:
Incidentally, I just realized you might want to clear the error. When you open up your .bashrc file, see if you can find a line that resembles the error you're getting, then comment it out.

Resources