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
上記の例では、実行権限+x
をrun-script.sh
に割り当てます