Search

6/09/2006

Shell Script Practice

一個shell script, 可以把活躍會員帳號轉為lftp的bookmark

#!/bin/bash
user="birdegg1108"
passwd=""

#sort -n 以數字排序
datas=`cat active.account|grep 3322.org|sort -n -t's' -k2|uniq`

for data in $datas
do
number=`echo $data|cut -d'.' -f1|cut -d'f' -f2`
if [ "$passwd" == "" ]; then
echo "$number \"ftp://$user@$data\""
else

echo "$number \"ftp://$user:$passwd@$data\""
fi
done

tag: linux bash shell script

沒有留言: