I have a verilog file that has multiple modules defined containing various input and output variables . I need to find out last occurrence of such variable (input/output) using sed script. I run the following command
address=sed -n '100,200{/output/=};100,200{/input/=}' file.txt
its giving me output as 102 103 104 105 106
while I want only 106.
Please suggest me some way.