Creating `subl` alias does not actually work [closed] - macos

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
After I upgraded Maverick, this all happened.
But my alias subl no longer works for Sublime Text Editor.
So I did this :
sudo ln -s "/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl" /usr/bin/subl
Which successfully creates the executable in my /usr/bin/ folder where all my other executables are. However, even after restarting Terminal, it still does not respond to :
which subl
Or just :
subl

Your command
sudo ln -s "/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl" /usr/bin/subl
has "/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl" both in quotes and with an escaped space between Sublime and Text. Use one or the other.
So, first run
sudo rm /usr/bin/subl
to get rid of the old, incorrect symlink. Then, run
sudo ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/bin/subl
(without the escape) and you should be all set.

Related

Export command not found on mac terminal [duplicate]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I added something to my bash_profile while trying to add Playframework to my path and something got messed up badly.
I added the following line to my .bash_profile
export PATH=$PATH:the path to my play excitable
then I saved everything and restarted my terminal. I can no longer do anything from my terminal. I can't cd into any directory, I can no longer find java, I can't open vi or nano.
I found this thread on SuperUser that suggested opening a different terminal and changing the bash profile.
I tried opening bash by typing
/bin/bash
and I was successfully able to open another terminal but I still don't have access to any of the regular unix commands. I still wasn't able to open vi or nano to remove the line that is causing the problem.
I tried downloading a new terminal application without any luck.
I tried turning on hidden files so that I can just change the file with a text editor by running the following command:
defaults write com.apple.finder AppleShowAllFiles TRUE
but since my terminal isn't working that didn't work either.
How can I fix my computer.
While this is offtopic for stackoverflow, it's also pretty simple to fix:
Start Terminal.app.
Reset $PATH:
$ export PATH=/bin:/usr/bin:/usr/local/bin
Fix ~/.bash_profile:
$ vi ~/.bash_profile
Or you can avoid setting $PATH at all with:
$ /usr/bin/vi ~/.bash_profile

Open a terminal via gnome-terminal then execute command, error : "failed to execute child process"" [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 years ago.
Improve this question
Via a bash command, I want open a terminal and, from the new terminal, execute a simple bash command.
I tried:
gnome-terminal -- "/bin/bash -c ls"
But I got this error:
I don't understand the error and I cannot find an example anywhere for help.
The quotes are telling the terminal to run an executable in /bin called bash -c ls (with the spaces as part of its name!). There exists no such executable.
Take them out:
gnome-terminal -- /bin/bash -c ls
...or, to actually make something stay open until the user provides input...
gnome-terminal -- /bin/bash -c 'ls; read'

Emacs gone from Mac OS Terminal - Only GUI version left [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
I have recently removed Emacs from my Mac OSX Yosemite, and have a beginner's beginner's problem in re-installing it and running it from the terminal. I can open the Emacs app GUI from the Applications folder, but cannot use Emacs from within the Terminal whatsoever.
I removed the old version of Emacs by using the command:
$ sudo rm /usr/bin/emacs
$ sudo rm -rf /usr/share/emacs
Then I installed the newest version of Emacs through Homebrew, using the code
$ brew install emacs --with-cocoa.
Now, when I type the command emacs in the terminal, I get "/usr/local/bin/emacs: No such file or directory."
I tried to add the following lines in a file named "emacs" in /usr/local/bin:
#!/bin/sh
/Applications/Emacs.app/Contents/MacOS/Emacs "$#"
But now, when I type the command emacs in the terminal I get: "-bash: /usr/local/bin/emacs: Permission denied"
Any suggestions? Thanks in advance!
My crystal ball tells me that you forgot to chmod +x /usr/local/bin/emacs.
You don't need a script, use a symbolic link.
$ ln -s /Applications/Emacs.app/Contents/MacOS/Emacs /usr/bin/emacs

How can I make my vim behave like my cat? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
Current I have the following going on, vim seems to inexplicably enter into the first folder it finds and continue tab completion from there.
When hinting a more complete name, it just gives me a bell.
~ $ cat .bash <TAB>
.bash/
.bash_history
.bash_profile
.bashrc
~ $ vim .bash <TAB>
~ $ vim .bash/ <TAB>
~ $ vim .bash/git-aware-prompt/
~ $ vim .bash_ <TAB>
<BELL>
Using vim 7.4.488 on OSX
How can I make my vim behave like my cat?
Sometimes it can happen that this is not in your .bashrc
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
. /etc/bash_completion
fi
Another possible issue can be resolved by running
complete -r vim
which can restore vim rules of completion to its default. I hope these suggestions can help you to point you in the right direction.

Whitespace added after path following a command with sudo [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
When I try to execute a command as super user that is followed by a path, the auto-complete (tab) will produce a whitespace after the folder:
Example, in my home folder:
"sudo cat Doc" <tab>
produces
"sudo cat Documents "
as opposed to
"sudo cat Documents/"
This is quite annoying. Any ideas what may be wrong? Did I break it or is this simply a bug?
I am running Linux Mint 13 Mate 64.
You can use bash-completion for the issue. For Debian/Ubuntu
sudo apt-get install bash-completion
This topic seems to fix it.
I am still unsure why this occurred though. I am quite certain it wasn't an issue until today.

Resources