Article 565YE Know the current filename sed is processing and to inform it to shell

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.latest?d=yIl2AUoC8zA latest?i=htYx8iOSAag:8PLXz3o6ZIU:F7zBnMy latest?i=htYx8iOSAag:8PLXz3o6ZIU:V_sGLiP latest?d=qj6IDK7rITs latest?i=htYx8iOSAag:8PLXz3o6ZIU:gIN9vFwhtYx8iOSAag
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments