0

I am writing a script that copies some files to

~/Library/Application Support/... 

directory. This script will fail on a non english mac because Library/Application Support may be called in a different name.

How can I get a localized special folder name in bash?

Yosemite 10.10.2

taminov
  • 591
  • 7
  • 23
  • 1
    possible duplicate of [Looking up user Library folders on OSX from a bash script?](http://stackoverflow.com/questions/25047065/looking-up-user-library-folders-on-osx-from-a-bash-script) – taminov Feb 16 '15 at 18:18

1 Answers1

3

OS X does not localize the names of files or folders on disk. It only localizes them in the GUI.

/Applications is always /Applications on disk or when accessed at the BSD/POSIX API layer. In German, that folder will be displayed as "Programme", but the actual directory name on disk is still "Applications".

Same for ~/Library/Application Support and the rest.

The link provided by taminov in the comments is still good, though, since you should theoretically always look up such paths using the appropriate API. But it has nothing to do with localization.

Ken Thomases
  • 88,520
  • 7
  • 116
  • 154