9
9

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.

シェル内でセパレータを引く

Last updated at Posted at 2012-12-22

シェル内でログとログの間や作業と作業の間を分かりやすくするために横線を引いてセパレータにしたいことがたまにあります.
そこで簡単なコマンド separate を作ってみました.

function separate(){
    echo -n $fg_bold[yellow]
    for i in $(seq 1 $COLUMNS); do
        echo -n '~'
    done
    echo -n $reset_color
}

シェルで separate と打つと黄色い波線が表示されて,コマンドラインの区切りをわかりやすくします.

separator

線の色を変えたり,線のパターンを単なる ~ の繰り返しではなく顔文字にしたりするともっと色々楽しめそうですね(セパレータという本来の意味を失いそうですが)
なお,$fg_bold のために zsh の colors モジュールをロードしています.

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?