LoginSignup
0
0

More than 5 years have passed since last update.

Shell Bang (シェバング)について

Last updated at Posted at 2016-08-08

shebangとも書くらしい。

用途


ファイルの一行目に書いて、ファイル内のスクリプトを読み込むインタプリタを指定する。


・phpファイルを実行するときに、わざわざ行頭にphpと書くのがめんどくさい場合
->ファイルの一行目にphpへのパス*1を#!の後ろに書く

僕の場合
#!/usr/local/bin/php

すると、今までindex.phpを実行するのにphp index.phpとしてたのを./index.phpでできるようになる
(あんまり変わってねぇ。。。)

*1phpへのパス
whereis php
where php
which php
などで探してください

0
0
0

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