LoginSignup
0
1

More than 5 years have passed since last update.

Terminal 上からファイルを GUI アプリケーションで開く(シェルスクリプト)

Last updated at Posted at 2018-02-17

こんにちは。
macOS の Terminal 上からファイルを GUI アプリケーション(/Applications 内のアプリケーションを想定)で開くためには、open コマンドを使えば良いですが1、これをシェルスクリプト化してみました2

$ chmod u+x espr.sh
$ alias espr=espr.sh
$ espr file.html
espr.sh
#!/bin/sh
open -a Espresso "$*"
exit $?

  1. Mac でコマンドラインからアプリケーション起動」も参考になります。 

  2. なお最初からそのようなコマンドを提供している GUI アプリケーションも多いようです(例えば、CotEditor では cot コマンド)。 

0
1
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
1