1
1

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 5 years have passed since last update.

何の shell を使っているか確認する方法

Posted at

確認方法

$ set | grep -ai version

csh / tcshの出力例

version tcsh 6.17.00 (Astron) 2009-07-10 (i386-intel-FreeBSD) options wide,nls,dl,al,kan,sm,rh,color,filec ...

bashの出力例

BASH_VERSION='4.3.11(1)-release'

zshの出力例

ZSH_VERSION=4.3.14

grep memo

option 意味
-a バイナリファイルであってもテキストとして処理する。
-i 大文字小文字を区別しない。
  • 「grep」コマンドや「sed」コマンドなどで語句を探すときに正規表現を使うと,複雑なパターンが簡潔に記述できる。grepやsedコマンドで利用できる代表的な正規表現を以下の表に示した。

記号 意味

.	改行文字以外の任意の1文字
*	直前の1文字の0回以上の繰り返しに一致。直前の文字は正規表現でも構わない
^	行の先頭
$	行の末尾
[ ]	かっこ内の任意の1文字に一致。ハイフン(-)で範囲指定もできる
[^ ]	かっこ内の任意の1文字に不一致。ハイフン(-)で範囲指定もできる
\+	直前の文字の1個以上の繰り返しに一致
\?	直前の文字の0または1文字に一致
\{n\}	直前の文字のn個の繰り返しに一致
\{n,\}	直前の文字のn個以上の繰り返しに一致
\{,m\}	直前の文字のm個以下の繰り返しに一致
\{n,m\}	直前の文字のn個以上,m個以下の繰り返しに一致
pattern1\|pattern2	pattern1またはpattern2のいずれかに一致
\(pattern\)	patternをグループ化する。マッチした内容は参照できる
\	正規表現に使われる記号を普通の文字として扱う

参考
http://server-setting.info/freebsd/what-shell.html
http://itpro.nikkeibp.co.jp/article/COLUMN/20060228/231171/

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?