2009-01-01から1ヶ月間の記事一覧

bashプロンプトに色を付ける|set color of prompt

プロンプトを緑色に設定する|set color of prompt to green GREEN="0;32" START_COLOR="\e[${GREEN}m" END_COLOR="\e[0m" export PS1="${START_COLOR}[\u@\h \W]\$${END_COLOR} " 色を変えたい部分を ${START_COLOR} と ${END_COLOR} で囲む|change color be…

Perlの始め方|How to start to learn perl

man perlintro

bashの履歴を複数端末で共有する|How to share bash history in multiple terminals

~/.bashrc に以下を設定|add follow settings in ~/.bashrc # Make bash append rather than overwrite the history on disk shopt -s histappend # Whenever displaying the prompt, write the previous line to disk and read unread history lines export…

1日毎に交互に2つ処理を実行する|do two commands day by day

現在日時を1970年からの日数に変換し、その数が偶数、奇数で処理を振り分ける|calculate days from 1970. when the days is even, do one command and when the days is odd, do another command. #!/bin/sh set -u A=`date +%s` echo $A is seconds from 19…