Y
Y
Yuriy Berg2015-06-20 08:57:22
macOS
Yuriy Berg, 2015-06-20 08:57:22

How to spell alias correctly in Mac OS X?

Hello everyone, I'm trying to write Alias ​​in .bash_prompt
, I write like this alias sublime='open the path to the program'
The program opens without any problems, but only when you need to open some additional file in this program, nothing comes out, I write like this ... Already using the sublime index.html alias, the following happens, the sublime text and index.html program opens in the browser. How can I fix this?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
varzin, 2015-06-20
@art_haacki

sub() { # Создаем функцию для открытия файла или папки в Саблайме
  if [ -z "$1" ] # Если параметр пустой
  then # То открываем в Саблайме текущую папку
    open -a Sublime\ Text "$(pwd)"
  else # Если не  пустой, то открываем файл, который написали в параметре
    open -a Sublime\ Text "$1" 
  fi
}

Well, respectively, use:
sub- opens the current folder
sub index.html- opens a specific file

A
AmikoYuki, 2015-06-20
@AmikoYuki

What the hell is all this?
We smoke.
https://www.sublimetext.com/docs/3/osx_command_lin...

D
Dmitrii Solovev, 2015-06-21
@dimonnwc3

Alias ​​is not needed, CLI is already built into the sublime.
and write the variable to .bashrc if it doesn't work:
export PATH=/usr/local/bin:$PATH

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question