unix コマンドの powershell の翻訳を手伝ってもらえませんか。
cat filename |sed 's/ *$//' >fileout
ありがとう
私はそれを正しく理解したかどうかわかりません。行末をトリミングするための正規表現だったと思います。
(Get-content filename) | % { $_ -replace ' *$', '' } | Set-content filename
エイリアスのおかげで、次のようにさらに親しみやすくすることができます。
(cat filename) | % { $_ -replace ' *$', '' } > filename
次のようにすることもできます。
(Get-content filename) | % { $_.TrimEnd() } | Set-content filename