#!/bin/sh
a="111 222 333"
b=(${a})
echo b[0] is ${b[0]}
echo b[1] is ${b[1]}
#!/bin/shsource ./conf.sh
output="user_budget.csv"echo "userid,budget">$outputwhile read line ; do userid=$line tno=`expr ${userid} % 8` sql_bridge="select sum(daily_budget) from FC_XW.idea_json${tno} where userid=$userid and is_del=0 and state=1;" result=`mysql -N -s -r --default-character-set=utf8 -h${FCXW_HOST} -P${FCXW_PORT} -u${FCXW_USER} -p${FCXW_PASSWORD} -e "${sql_bridge}"` if [ "$result" == "NULL" ]; then result=0 fi echo "$userid,$result" >> $outputdone < input_userlist.txtecho "all done"