Portál AbcLinuxu, 10. května 2025 12:33
autoanswerA=($(/pgsql/bin/psql -h $hostdb -U $userdb $db -tAc "select * from autoanswer;"))
i=0
while [[ $i -lt ${#autoanswerA[@]} ]]
do
id=$(echo ${autoanswerA[$i]}|cut -f1 -d'|')
mail=$(echo ${autoanswerA[$i]}|cut -f2 -d'|')
od=$(echo ${autoanswerA[$i]}|cut -f3 -d'|')
do=$(echo ${autoanswerA[$i]}|cut -f4 -d'|')
subject=$(echo ${autoanswerA[$i]}|cut -f5 -d'|')
text=$(echo ${autoanswerA[$i]}|cut -f6 -d'|')
activ=$(echo ${autoanswerA[$i]}|cut -f7 -d'|')
i=$(($i+1))
done
V první řadě by jsi mohl třeba hodit Tvůj kód mezi tagy <pre></pre>
, aby čitelný. V druhé řadě by jsi měl být víc konkrétní. Co máš v DB a čeho chceš dosáhnout?
autoanswerA=($(/pgsql/bin/psql -h $hostdb -U $userdb $db -tAc "select * from autoanswer;")) i=0 while [[ $i -lt ${#autoanswerA[@]} ]] do id=$(echo ${autoanswerA[$i]}|cut -f1 -d'|') mail=$(echo ${autoanswerA[$i]}|cut -f2 -d'|') od=$(echo ${autoanswerA[$i]}|cut -f3 -d'|') do=$(echo ${autoanswerA[$i]}|cut -f4 -d'|') subject=$(echo ${autoanswerA[$i]}|cut -f5 -d'|') text=$(echo ${autoanswerA[$i]}|cut -f6 -d'|') activ=$(echo ${autoanswerA[$i]}|cut -f7 -d'|') i=$(($i+1)) doneUpozornuji ,ze v programovani jsem beginer :=) a snazim se naprogramovat do naseho mailoveho systemu automatickou odpoved tahanou z db.
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.