dotnet run app.cs 명령어의 기능이 Preview 7을 기점으로 완성된 것 같습니다. 이제 stdin으로부터 코드를 읽는 것도 지원합니다.

예를 들어, 다음과 같이 인라인으로 표현이 가능합니다. (DOS 명령어 기준)

echo var a = 1; var b = 2; Console.WriteLine($"{a+b}"); | dotnet run -

그리고 Bash 셸에서 널리 쓰이는 것과 같이 C curl이나 wget을 통해서 인터넷에서 스크립트를 받아와서 실행할 수 있게 되었습니다. 예를 들어, Windows에 내장된 curl.exe를 사용하여 다음과 같이 실행할 수 있습니다. (피보나치 수열 코드 샘플입니다.)

curl.exe -s -L https://gist.githubusercontent.com/rkttu/209a86bc63970116681443807104b963/raw/b6ba98195268ed2d9a14d65988e1e68dab1a4b25/fibonacci.cs -o - | dotnet run -

이제 이로써 C 컴파일러 언어이지만 동시에 스크립트 언어로서의 지위를 누릴 수 있게 되었습니다. 정말 오래 기다렸습니다. 🙏

https://forum.dotnetdev.kr/t/net-10-preview-7-is-now-available-net-blog/13566/2?u=rkttu

0

If you have a fediverse account, you can quote this note from your own instance. Search https://hackers.pub/ap/notes/0198a29a-919f-7db6-9fe0-94d39fc680b8 on your instance and quote it. (Note that quoting is not supported in Mastodon.)