#!/bin/sh s="off \\" if [ -f ./nozen ]; then DIALOG=dialog else DIALOG=Xdialog fi x=1 if [ -f clientmp ];then rm clientmp fi cp client clientmp ls ../clients|while read line;do b=`echo $line |cut -d" " -f1|cut -c 1` if [ "$b" = "/" ];then f=1 else f=2 fi line=`echo $line |cut -d" " -f$f` echo $line "-" $s >>clientmp echo $x>tmp x=$(( x + 1 )) done y=`cat tmp` rm tmp sed -i s/zzz/$y/g clientmp echo "2>ans">>clientmp chmod +x clientmp . ./clientmp if [ ! $? = 0 ];then exit 1 fi clientdir=`cat ans|cut -d'"' -f2` rm ans #echo $clientdir