タグ

bashに関するnaoh16のブックマーク (2)

  • 私が他人のシェルスクリプトから学んだこと | Yakst

    私はシェルスクリプトの大ファンで、他人のスクリプトから面白い方法を学ぶのが大好きだ。最近、SSHサーバの2要素認証を簡単にするためのauthy-sshスクリプトに出会った。このスクリプト群を見まわしていて、みんなと共有したいたくさんのクールなことを見つけた。 出力に色付けする 出力文字列を、成功した時は緑に、失敗した時は赤に、警告は黄色に色づけしたいと思うことはたくさんあるだろう。 NORMAL=$(tput sgr0) GREEN=$(tput setaf 2; tput bold) YELLOW=$(tput setaf 3) RED=$(tput setaf 1) function red() { echo -e "$RED$*$NORMAL" } function green() { echo -e "$GREEN$*$NORMAL" } function yellow() { e

    私が他人のシェルスクリプトから学んだこと | Yakst
    naoh16
    naoh16 2013/08/21
  • BASH Help - A Bash Tutorial

    Getting Started with BASH A Bash Tutorial What is the Bash Shell? Bash's Configuration Files Modifying the Bash Shell with the set Command Set Emacs Mode in Bash Commands to take advantage of bash's Emacs Mode Set Vi Mode in Bash Commands to take advantage of bash's Vi Mode Useful Commands and Features Flip the Last Two Characters Searching Bash History Dealing with Spaces Using the Backslash Esca

  • 1