0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

WindowsのPowerShellでBashを実行

Posted at

PowerShellでBashを実行するのに苦労したので、備忘録。

まず、内容は以下の通りです。

test.sh
#!/bin/bash

# echo "bashでこの行はコメントです"
echo "bashでこの行はコメントではありません"

これを実行したくて色々試しました。
結論は、shのあるディレクトリに移動して、以下のコマンド。

PowerShell
 bash ./test.sh

どうやらWindowsのPowerShellではbashを経由しないとファイルとして認識されるみたいです。
何度./test.shでファイルを開いたことか……。

何故Windowsではbashを経由しないといけないのか、はまた別途調べてこの記事に追記します。

あ~、解決してよかった~!!

0
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?