- setenv equivalent on mac?
- 3 Answers 3
- Not the answer you’re looking for? Browse other questions tagged macos bash setenv or ask your own question.
- Linked
- Related
- Hot Network Questions
- Subscribe to RSS
- Неудачное обновление до Льва: макбук больше вообще не грузится. РЕШЕНО
- Установка и работа с менеджером пакетов для Maс OS X (MacPort и Homebrew)
- 1. MacPort
- 2. Homebrew
- Set the System Time in Mac OS X from the Command Line
- Set System Date in Mac OS X from Command Line with a Central Time Server
- Set the Mac System Date Manually by Terminal Command
- Install and set up Remote Desktop
setenv equivalent on mac?
I want to set an environment variable using setenv:
But setenv gives me an error saying the command is not found. Does anyone know how to perform the MAC OSX equivalent of setenv? Thanks!
3 Answers 3
you want export
or on 1 line export NODE_ENV=localhost
and this has nothing to do with OSX per se, more to do with bash vs (t)csh as your shell
Best for Mac is:
if you want to make the variable persistent and avoid rebooting.
Are you a Cshell person?
The earlier versions of OS X came with tcsh as the default shell since OS X is based upon BSD. However, Mac OS X comes with BASH as the user’s default shell.
Macs still come with Turbo Csh too and you can make this your default shell if that is your desire. In the terminal, type:
If you decide you want switch back to BASH:
You can see a list of all possible shells in the /etc/shell file.
Not the answer you’re looking for? Browse other questions tagged macos bash setenv or ask your own question.
Linked
Related
Hot Network Questions
Subscribe to RSS
To subscribe to this RSS feed, copy and paste this URL into your RSS reader.
site design / logo © 2021 Stack Exchange Inc; user contributions licensed under cc by-sa. rev 2021.10.8.40416
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.
Источник
Неудачное обновление до Льва: макбук больше вообще не грузится. РЕШЕНО
Очередной ламер просит очередной помощи.
Есть Макбук Про 2008 г. со Снежным Леопардом и последними обновлениями (по крайней мере, соглашался на все предлагаемые по состоянию на 20 июля 2011 г.)
Уехал в отпуск после 20ого июля. Приехал вчера, т.е. 5 августа. Вижу — наконец вышел Лев. Загрузил инсталлятор через АппСторе, все официально, денежку заплатил.
Запустил инсталлятор, тот запросил закрыть все работающие программы, на что я ответил согласием. Гляжу, что-то ничего не происходит. Ладно, сам закрыл все, что можно. Запустил инсталлятор повторно. Тот через некоторое время запустил перезагруз системы.
И все. Больше макбук вообще не запускается. После включения и приветственого звука появляется знакомое яблоко и спустя пару секунд поверх него предложение перезагрузиться на 5 языках и куча сообщений об ошибках, из которых я понял, что что-то пошло не так: там тебе и «паник» и «кернел» и «дебуггер». Но самое страшное я понял в сообщении: «Mac OS Version: not yet set», то бишь система вообще не установлена или не распознается компом.
По ссылке ниже можно загрузить скриншот того, что творится на экране:
Что я пытался до сего момента сделать:
— включить макбук, удерживая OPTION — появился значок жесткого диска (при этом внешний подключенный не отобразился). После нажатия на значок вылезла знакомая вышеописанная картина с ошибками
— загрузить макбук в безопасном режиме (COMMAND + S) — не загружается, останавливается на сообщение об Аптайме системы через сколько-то там наносекунд.
Теперь вопросы, господа:
1. Что я сделал не так? Может за время моего отпуска (20.07-05.08) вышло какое-то очередное обновление Леопарда, без которого Лев не ставится?
2. Что теперь делать? Как откатиться или продолжить установку? (Сразу говорю, что дело дрянь: установочного диска нет никакого вообще.
3. У меня есть запасной писюк с пишущим приводом и свежая флешка на 8 гигов. Вопрос: можно ли в Винде записать установочный / загрузочный диск под Мак?
UPD: Вчера глубокой ночью таки запустил макбук через установочную ЮСБ-флешку со Львом (установил на Винде через TransMac).
Лев, правда, так и не установился, по крайней мере поверх Барса. В ходе установки мне было предложено воспользоваться дисковой утилитой, что я и сделал. Тут меня ждали сюрпризы. Утилита выдавала сообщения, что она не может завершить ни проверку, ни исправление диска, ни восстановление прав.
Барс запустился без проблем и глюков. Но на всякий случай я решил попробовать откатиться к одной из резервных точек Time Machine. К моему удивлению, и этого я не смог сделать — программа, обнаружив внешний диск, на который были сохранены данные Time Machine, тем не менее, в следующем шаге не смогла определить НА какой диск можно восстановиться. То есть родной жесткий диск с Барсом даже не появился в списке. Там вообще ничего кроме строки «Поиск дисков. » не появилось.
Источник
Установка и работа с менеджером пакетов для Maс OS X (MacPort и Homebrew)
Менеджер пакетов в Mac OS X позволит нам легко работать с пакетам посторонних разработчиков. В этом топике рассмотрим два таких менеджера: MacPort и Homebrew.
1. MacPort
Официальний сайт
На этом же сайте можна найти Mac OS X Package (.pkg) Installer для Mountain Lion, Lion, Snow Leopard и Leopard. Установите подходящий вам пакет и пользуйтесь на здоровье. Есть и другие способы установки, но мы выбрали простой и быстрый. На случей чево, у меня port установился сюда: /opt/local/bin/port.
Требование:
Работать с port придельно просто — ищем в «портах» нужный пакет и устанавливаем его:
Дополнительные команды:
2. Homebrew
Официальная страница
О Homebrew поговорим подробнее…
Требование:
Установка:
После успешной установки виполним следующую команду:
Если в результате этой команди получим ответ: «Your system is raring to brew», тогода все хорошо и можете спокойно начинать работу з brew. В ином случае продолжим…
Если возникла ошибка Warning: Experimental support for using Xcode without the «Command Line Tools», то скорее всего была обновлена «ось», к примеру, с Lion к Mountain Lion, но не была переустановлена Command Line Tools для Xcode.
Если возникла ошибка Error: No such file or directory — /usr/local/Cellar, то нужна создать эту директорию:
После этого опять запускаем команду:
Если мы получим что-то вроде этого:
то исправляем примером так:
Проверяем ище раз:
Если на этот раз никаких ошибок не произошло, тогда все — можна спокойно работать с Homebrew.
Источник
Set the System Time in Mac OS X from the Command Line
The clock in Mac OS X sets itself automatically by default, but if you want to set the precise time or are looking for a command line solution to set system time, you can do so with a tool called ntpdate, or the standard ‘date’ command.
Set System Date in Mac OS X from Command Line with a Central Time Server
For ntpdate, which sets the date and time based on the time from a central server accessed via the internet, you’d want to point it either at Apple’s time servers or pool.ntp.org as follows to get the exact time:
sudo ntpdate -u time.apple.com
Enter the admin password when asked, and you’ll soon see something like the following:
4 Jul 14:30:11 ntpdate[28267]: adjust time server 17.151.16.14 offset 0.000336 sec
The offset at the end lets you know how divergent the system clock was with the newly set time. In this example, the system clock was off by a laughably small fraction of a second.
You generally don’t need to do this if you use the “Set date and time automatically” feature within the Date & Time system preferences, though by setting clocks through the command line you could be sure that each machine on a network shows the exact same time.
Set the Mac System Date Manually by Terminal Command
Another approach is to set the date manually from the command line by using the “date” command string, where date is in the [mm][dd]HH]MM[yy] format, which is Month Date Hour Minute Year without any separation. This looks something like:
For that example, it would set the date as “July 12 2018 at 12:23”.
You can learn more about setting the date with date –help, which also specifies that you can even set the seconds if you want to.
The ‘date’ trick is what you’d want to use if the Mac in question does not have internet access for one reason or another.
Источник
Install and set up Remote Desktop
To use Remote Desktop, your administrator and client computers must meet these requirements:
Mac computers must be running OS X 10.10.5 or later.
Mac client computers must have version 3.6 or later of the Remote Desktop client software for full control.
Although you may be able to control and observe Mac computers using earlier versions of the Remote Desktop client software, you can’t generate reports or execute remote commands.
To find the client software version, when you’re using Remote Desktop, select the computer, choose File > Get Info, and look at the ARD Version field. To find the client software version on Mac computers you haven’t yet added to the All Computers list, go to the computer, locate the following file in the Finder, and check its version:
Non-Mac client computers must have Virtual Network Computing (VNC)–compatible software.
When you install Remote Desktop and open it for the first time, use the setup assistant to finalize configuration. After configuration, you start administering computers by adding clients to the main list of computers.
Download Remote Desktop from the App Store.
If you have another copy of Remote Desktop acting as a Task Server (a dedicated computer for report data collection and delegated install tasks), enter the server address, then click Continue.
Prepare each client computer to be managed using Remote Desktop. The Remote Desktop client software is installed by default in macOS.
Select the Scanner in the sidebar, and select each client computer that you want to add to your list of controlled computers.
Источник