0
0

More than 1 year has passed since last update.

シェルスクリプト

Posted at

現在のシェルを調べる

$ echo $SHELL
#/bin/bash

使用可能なシェルを調べる

$ cat /etc/shells
# List of acceptable shells for chpass(1).
# Ftpd will not allow users to connect who are not using
# one of these shells.

#/bin/bash
#/bin/csh
#/bin/dash
#/bin/ksh
#/bin/sh
#/bin/tcsh
#/bin/zsh

シェルの変更

使用するターミナルのシェルを変更する。ターミナルを再起動すると変更される。

$ chsh -s /bin/csh

出力

シェルスクリプトの作成をする。

# 改行する
$ echo 'test\n'
# 'のエスケープシーケンス
$ echo test\'test\'test

# ヒアドキュメントの活用
cat << MESSAGE
hoge
fuga
MESSAGE

参考リンク

初心者向けシェルスクリプトの基本コマンドの紹介

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