![第51回 Plamo Linuxの遊び方(その2) | gihyo.jp](https://cdn-ak-scissors.b.st-hatena.com/image/square/df119a38fccdcd82430993ac675c302e1bde6d4c/height=288;version=1;width=512/https%3A%2F%2Fgihyo.jp%2Fassets%2Fimages%2FICON%2F2022%2F1900_zgan_new.png)
はじめに bash などのシェルには [ ... ] と [[ ... ]] の二種類の比較方法があります。一つはコマンド、もう一つはシェルの文法なのですが、具体的にはこの二つは一体何が違うのでしょうか? そもそもなぜ似ている機能が二つもあるのでしょうか? この記事は言語設計者の気持ちになって考えることで、その理由を解き明かそうという記事です。 なお、違いについての簡単な説明については「test と [ と [[ コマンドの違い - 拡張 POSIX シェルスクリプト Advent Calendar 2013 - ダメ出し Blog 」の記事がよくまとめられていますので紹介します。一通りの違いを素早く知りたい方はこちらを参照してください。 参考 シェルの歴史や種類については「シェルの歴史 総まとめ(種類と系統図)と POSIX の役割」に詳しくまとめています(系統図とか頑張って書いたので見
この記事は Vim Advent Calendar 2016 (その2) の3日目の記事です。 ノーマルモード以外をパイプとして使う際の情報を追記しました (2016/12/04) UNIXのテキスト処理 UNIXでテキストを自動整形する際、パイプ機能は欠かせない。 $ cat a.txt 1 hoge 2 piyo 3 fuga $ cat a.txt |sed 's/piyo/foo/' |grep '2' 2 foo シェル上で | というパイプ記号を使ってコマンドを次々繋げることで、複雑なテキスト処理をこなすわけだ。 パイプは便利だが、テキストエディタをパイプとして使う人はあまり見かけない。 テキストエディタ=対話的 という常識があるため、パイプのような自動処理とは相性が悪いと思われているのだろう。 しかし今日はあえて、シェルスクリプトやワンライナーの中にvimを埋め込み、パイプと
Bash has several prompts which can be customized to increase productivity, aesthetic appeal, and nerd cred. Prompts Bash has five prompt strings that can be customized: PS0 is displayed after each command, before any output. PS1 is the primary prompt which is displayed before each command, thus it is the one most people customize. PS2 is the secondary prompt displayed when a command needs more inp
Introducing pass Password management should be simple and follow Unix philosophy. With pass, each password lives inside of a gpg encrypted file whose filename is the title of the website or resource that requires the password. These encrypted files may be organized into meaningful folder hierarchies, copied from computer to computer, and, in general, manipulated using standard command line file ma
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く