alias


安心cp & mv

alias mv mv -i
alias cp cp -i

安全reboot & halt

alias halt "printf 'now halting.' ; sync;sleep 1;printf . ;sync;sleep 1;printf . ;sync;sleep 1;printf . ;halt"
alias reboot "printf 'now rebooting.' ; sync;sleep 1;printf . ;sync;sleep 1;printf .;sync;sleep 1;echo .;reboot"

DISPLAYをセット

setd(){
	export DISPLAY=`who -m |cut -d"(" -f2 |cut -d")" -f1`:0.0
	echo "DISPLAY=$DISPLAY"
}

matlab

alias matlab matlab -nojvm -nosplash


shellscript

Eject

#!/bin/sh
umount /mnt/cdrom 2> /dev/null
eject 
sleep 6
eject -t
mount /mnt/cdrom 2> /dev/null

del

#!/bin/sh

if [ $# -ne 1 ]
then
    echo "Usage :del filename" >&2
    exit 1
fi
gzip $1
mv $1.gz /dump

gnuplot3

#!/bin/sh

if [ $# -lt 1 ]
then
    echo "Usage:gnuplot3 [option] input_file1 , inpufile2, ..." >&2
    printf "option\n\t-x : x-lange [n:m]\n\t-y : y-range [n:m]\n" >&2
    printf "\t-s : style lines(default) ,box , ... \n" >&2
    printf "\t-o : output X(default) ,eps ,eps-color ,tgif \n" >&2
    printf "\t-set: set ....\n" >&2
    exit 1
fi
############### オプション ##################
while [ $# -ge 0 ]
do
    case $1 in
        -x) shift 
            X_RANGE=$1
            shift
            continue ;;
        -y) shift
            Y_RANGE=$1
            shift
            continue;;
        -o) shift
            OUTPUT=$1
            shift
            continue;;
        -s) shift
            STYLE=$1
            shift
            continue;;
        -set) shift
            SET=$1
            shift
            continue;;
    esac

    FILE_NUM=$#
    break
done

################ 出力の設定 ################
if [ ${OUTPUT=X} = X ]
then
    echo " " > /tmp/tempfile.gnuplot.${USER}

elif [ ${OUTPUT=X} = eps ]
then
    echo "set terminal postscript eps" > /tmp/tempfile.gnuplot.${USER}
    echo "set output \"${HOME}/tempfile.gnuplot3.${USER}.output\" " >> /tmp/tempfile.gnuplot.${USER}

elif [ ${OUTPUT=X} = eps-color ]
then
    echo "set terminal postscript eps color " > /tmp/tempfile.gnuplot.${USER}
    echo "set output \"${HOME}/tempfile.gnuplot3.${USER}.output\" " >> /tmp/tempfile.gnuplot.${USER}
    
elif [ ${OUTPUT=X} = tgif ]
then
    echo "set terminal tgif " > /tmp/tempfile.gnuplot.${USER}
    echo "set output \"${HOME}/tempfile.gnuplot3.${USER}.output\" " >> /tmp/tempfile.gnuplot.${USER}
    
fi

if [ ${SET=0} != 0 ]
then
    echo "set $SET" >> /tmp/tempfile.gnuplot.${USER}
fi

################# 本体 #####################
printf "plot " >> /tmp/tempfile.gnuplot.${USER}

printf "${X_RANGE=[]} " >> /tmp/tempfile.gnuplot.${USER}
printf "${Y_RANGE=[]} " >> /tmp/tempfile.gnuplot.${USER}

i=1
while [ $i -le $FILE_NUM ]
do
    printf "\"${1}\" "  >> /tmp/tempfile.gnuplot.${USER}
    printf "with ${STYLE=lines} " >> /tmp/tempfile.gnuplot.${USER}
    shift

    if [ $i -eq $FILE_NUM ]
    then
        printf "\n" >> /tmp/tempfile.gnuplot.${USER}
    else
        printf ", " >> /tmp/tempfile.gnuplot.${USER}
    fi

    i=`expr $i + 1`
done

gnuplot -persist /tmp/tempfile.gnuplot.${USER}
rm /tmp/tempfile.gnuplot.${USER}

if [ ${OUTPUT=X} != X ]
then
    cat ${HOME}/tempfile.gnuplot3.${USER}.output
    rm  ${HOME}/tempfile.gnuplot3.${USER}.output
fi

Last modified: Tue Jan 7 22:36:50 JST 2003