Know the current filename sed is processing and to inform it to shell
by BudiKusasi from LinuxQuestions.org on (#565YE)
How to know the current filename sed is processing and to inform it to shell environment variable
Find in all .txt files line with NA end if any.
If any then remove the line and quit with exit 0 (shell true), else exit any error code
Code:echo *.txt |xargs sed -Ei '/NA$/{d; q0}; q1 ' .....but how to get the file name if the condition is true to be echoing it (elipsis means the required answer on continuation) and won't echo it if it's false ?
Thanks.


Find in all .txt files line with NA end if any.
If any then remove the line and quit with exit 0 (shell true), else exit any error code
Code:echo *.txt |xargs sed -Ei '/NA$/{d; q0}; q1 ' .....but how to get the file name if the condition is true to be echoing it (elipsis means the required answer on continuation) and won't echo it if it's false ?
Thanks.