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?

More than 1 year has passed since last update.

Ubuntuでシェルスクリプトを作成・実行する方法

Posted at

シェルスクリプトの作成

まず、シェルスクリプトを作成します
まず、スクリプトを作りたいフォルダに移動して、
開いてるところで 右クリック→新しいドキュメント→空のドキュメント で、
ドキュメントファイルを作成します。(画像はファイルを作成したあとの様子)

image.png

そして、ファイルを 右クリック→テキストエディタで編集 で編集していきます

試しに、HelloWorld!と表示するスクリプトを書いてみましょう!

以下のテキストをそのまま貼り付けて保存してください

#!/bin/sh

echo "HelloWorld!"

そしたら、ファイルのプロパティを開き、「Executable as Program」をONにして閉じます
image.png

そして、ターミナルを開き、フォルダに移動して、
「./空のドキュメント」で実行できます

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?