Skip to content

Conversation

@DamianEdwards
Copy link
Member

@DamianEdwards DamianEdwards commented Nov 16, 2025

Changed the file-based apps hello-world.cs snipped to use a more widely usable shebang line:

#!/usr/bin/env dotnet

This should work on most *nix systems (including macOS) assuming dotnet is on the path.

Changed the file-based apps `hello-world.cs` snipped to use a more widely usable shebang line:

`#!/usr/bin/env dotnet`

This should work on most *nix systems (including macOS) assuming `dotnet` is on the path.
Copilot AI review requested due to automatic review settings November 16, 2025 00:07
@DamianEdwards DamianEdwards requested review from a team and BillWagner as code owners November 16, 2025 00:07
@dotnetrepoman dotnetrepoman bot added this to the November 2025 milestone Nov 16, 2025
Copilot finished reviewing on behalf of DamianEdwards November 16, 2025 00:09
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the shebang line in hello-world.cs to use a more portable format with /usr/bin/env. The change aims to make the file-based app example work across different *nix systems by using the environment's PATH to locate the dotnet CLI instead of hardcoding the path.

Key Changes

  • Changed shebang from #!/usr/local/share/dotnet/dotnet run to #!/usr/bin/env dotnet
  • Removed leading whitespace from the shebang line

Copy link
Member

@BillWagner BillWagner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @DamianEdwards

This is great, and I'll :shipit: now.

Also, created #49931 to update a related article

@BillWagner BillWagner merged commit 7ee7062 into main Nov 17, 2025
20 of 21 checks passed
@BillWagner BillWagner deleted the damianedwards/file-based-hello-world-snippet-shebang branch November 17, 2025 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants