V
V
Vitaly Nevzorov2015-06-24 22:14:12
linux
Vitaly Nevzorov, 2015-06-24 22:14:12

In a sh script, extract all but one line from a file and paste it into a command?

Dear community, hello.
Please tell me how to make such a construction:
I need all the lines from the file (subscriptions), except for the line containing the word (Spam)

grep -v -w "Spam" /var/www/site/.maildir/subscriptions

run through the team
sa-learn --ham /var/www/site/.maildir/cur/"Сюда вставить строки по одной"

I googled, and I seem to have found it, but I can’t figure out how to insert exactly one line at a time, or maybe there is a better way to do this?
Thank you all in advance and many thanks!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Moseychuk, 2015-06-24
@f1_real

grep -v -w "Spam" /var/www/site/.maildir/subscriptions | xargs -i sa-learn --ham /var/www/site/.maildir/cur/{}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question