I get an error sayinggrep -B 1 -i "Northbound to" file1 > file2 grep -B 1 -i "Southbound to" file1 >> file2
Is there another way of displaying one line before either or both matches? Obviously what I'm looking for is the interface that this is on. Below is a small portion of 'file1'. Thanks for any and all ideas.grep: illegal option -- B Usage: grep -hblcnsviw pattern file . . . grep: illegal option -- B Usage: grep -hblcnsviw pattern file . . .
interface POS2/1 bandwidth 155520 no ip address no ip directed-broadcast no ip proxy-arp load-interval 30 shutdown crc 16 ! interface POS2/2 description PL000000/00000000-O, NNI southbound To Somewhere fms 1111 +1111 no ip address no ip directed-broadcast no ip proxy-arp encapsulation frame-relay IETF no ip mroute-cache crc 16 frame-relay lmi-type cisco ! interface POS2/2.30 point-to-point description POS2/2.30 fr dlci=30. By VPNSC: Job Id# = 9999 ip vrf forwarding V1234:Customer ip address 192.168.254.2 255.255.255.252 no ip directed-broadcast snmp trap link-status no cdp enable frame-relay interface-dlci 30 IETF
In reply to Print line before match by ddrew78
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |