• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

$.getenv() on Mac

Mentor ,
Jan 17, 2017 Jan 17, 2017

Copy link to clipboard

Copied

Hi,

Looking for a help from Mac users...

Is

$.getenv("os")

returning any string on Mac or null?

Does it depends on MacOs version?

Jarek

TOPICS
Scripting

Views

1.3K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jan 17, 2017 Jan 17, 2017

Copy link to clipboard

Copied

Hi Jarek,

$.getenv('os') // return null

$.os // return Macintosh OS 10.12.2

Folder.fs  // return Macintosh

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Jan 17, 2017 Jan 17, 2017

Copy link to clipboard

Copied

LATEST

Hi Jarek.

Windows and Mac have different environmental variables, that explains the result.

Take the user name for example.

var userName = $.getenv($.os[0] == "M" ? "USER" : "username");

On Mac "USER" on Windows "username"

For a list of mac envs in terminal type: printenv

For windows from cmd (command promt) type: SET

The windows one is quite easy to remember

So in short there's no env on the mac called 'os'

HTH

Trevor

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines