Linux - 実行権限を.shファイルに割り当てる方法

Linux – .shファイルに実行許可を割り当てる方法

* nixでは、chmod +x file.shを使用して.shファイルを実行可能にすることができます。

ターミナル

$ ls -lsah
total 12K
4.0K drwxr-xr-x  2 example example 4.0K Feb   5 10:24 .
4.0K drwxr-xr-x 17 example example 4.0K Feb   5 10:24 ..
4.0K -rw-r--r--  1 example example   67 Feb   5 10:24 run-script.sh

$ chmod +x run-script.sh

$ ls -lsah
total 12K
4.0K drwxr-xr-x  2 example example 4.0K Feb   5 10:24 .
4.0K drwxr-xr-x 17 example example 4.0K Feb   5 10:24 ..
4.0K -rwxr-xr-x  1 example example   67 Feb   5 10:24 run-script.sh

上記の例では、実行権限+xrun-script.shに割り当てます