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

shellで対話形式に処理を進めるには

#!/bin/sh echo -n "input[y/n] : " while read YN; do case $YN in 'y' ) echo "your input y " break;; 'n' ) echo "your input n " break;; * ) echo -n "Please input [y/n] : ";; esac done exit 0

shellの実行パスを取得する

#!/bin/sh # #実行スクリプトパス # script_path=$0 echo "script_path:$0" # #実行スクリプト名 # script_name=$(basename $0) echo "script_name:$script_name" # # 実行パス # script_dir=$(cd $(dirname $0); pwd) echo "script_dir:$script_dir"

Linux ifconfigからgrepとsedを用いてipアドレスのみ取得する。

コマンド # /sbin/ifconfig eth0 | grep 'inet addr:' | sed -e 's/^.*inet addr://' -e 's/ .*//' 結果 192.168.0.123 ※良く忘れるので1ステップずつメモを残す。 eth0のip情報を表示 # /sbin/ifconfig eth0 eth0 Link encap:Ethernet HWaddr aa:bb:cc:dd:e…

Python Image Library(PIL) を CentOS 6の64bit環境で使えるようにする

参考にしたページは以下。http://itekblog.com/centos-6-x-install-pil-python-imaging-library-tutorial/EPEL リポジトリの登録が必要のようです cd /opt/ wget http://mirrors.nl.eu.kernel.org/fedora-epel/6/i386/epel-release-6-7.noarch.rpm rpm -Uvh …

Python Pillow を windows7 64bit環境で使えるようにする

windows7 64bit環境でPIL(Python Image Library)を試そうと思ったところ上手く行かず。 インストールしてあるpythonは python 2.7。64bit向けにコンパイルしてくれているサイトからダウンロードしました。http://www.lfd.uci.edu/~gohlke/pythonlibs/Pillow-…