Tag Archive: shell


A procedure watching script.

Input a procedure number and a mail address.
This script can keep watching the peocedure.
when the procedure terminated, it will send a mai to user.
——————-

#!/bin/bash
echo Procedure Checking: $1
while [ `ps -p $1 | wc -l | sed ‘s/[ t]*//’` -ne “1” ]
do
sleep 3
done
echo “Procedure $1 is terminated.” | mail -s ‘Task terminated notation’ $2

#!/bin/zsh
BINGAPPLICATIONID=”C54CB829E27500E5F679F8B78D2382D012BB4140″
BingTranslatorAPI=”http://api.microsofttranslator.com/v2/Http.svc/\
Translate?appId=$BINGAPPLICATIONID&text=$1&from=${2:-en}&to=${3:-zh-chs}”
echo “Translating the word \”$1\” from ${2:-en} into ${3:-zh-chs}”
wget -qO- $BingTranslatorAPI | sed ‘s/\//g’