Answer the question
In order to leave comments, you need to log in
How to make a subquery in the database in SED?
The task is simple, you need to display in a new line the domain name from the subquery in the database by ID in the mail
I look at the mail queues
mailq|grep ^[A-F0-9] |cut -c 42-80| sort | uniq -c| sort -n
2 [email protected]
5 [email protected]
6 [email protected]
8 [email protected]
10 [email protected]
27 [email protected]
mailq|grep ^[A-F0-9] |cut -c 42-80| sed -e s'/.*web\([0-9]\{1,\}\)\(@ks03.ru\)$/\1 /'g
217
217
137
221
178
178
178
217
137
221
178
178
174
217
178
178
137
178
178
178
178
178
LIST=$(mailq|grep ^[A-F0-9] |cut -c 42-80| sed -e s'/.*web\([0-9]\{1,\}\)\(@ks02.ru\)$/\1 /'g)
echo $LIST
for ELEMENT in $LIST
do
$ELEMENT"
mysql -uroot -p********* -N -B dbispconfig -e 'select domain from 'web_domain' where 'domain_id'=$ELEMENT;'
done
Answer the question
In order to leave comments, you need to log in
'web_domain', 'domain_id' in request context - string constants
`web_domain` - table
`domain_id` - field
' => `
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question