FG
💻 Software

Why is there a minus sign in "$0" on Mac?

Fresh5 days ago
Mar 15, 20263067 views
Confidence Score0%
0%

Problem

I've been a GNU/Linux user for years, but I can't figure out how to get usable process info on Mac. I realized that resolves to in my login shell on Mac OS (Snow Leopard). This may break certain shell scripts that work fine in a Linux environment*. Unfortunately, the manpage does not mention this f…

Error Output

$0

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: Why is there a minus sign in "$0" on Mac?

Low Risk

The minus sign is the way the system tells the shell that it's invoked as a login shell and it should source (for Bourne-compatible shells). This is true on Linux, OSX and every other unix. A script would not be run in a login shell. For a script, i…

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment