Dave
Dave

Reputation: 1255

How to use Linux watch against a command piping to sed

When I perform this command:

ip -s link show enp65s0f0 | sed -n '/    vf 4/,$p'

I get this output

    vf 4 MAC 00:00:00:00:00:00, vlan 3932, spoof checking off, link-state auto, trust off, query_rss off
    RX: bytes  packets  mcast   bcast
    3835259656164 3452586352 1       1098
    TX: bytes  packets
    3310560630151 3007239043

I want to watch that command, however when I run the following:

watch "ip -s link show enp65s0f0 | sed -n '/    vf 4/,$p'"

I get this error

sed: -e expression #1, char 16: unexpected `,'

Troubleshooting:

How can I get watch against my command piping to sed?

Upvotes: 0

Views: 229

Answers (1)

JsonKnight
JsonKnight

Reputation: 205

you have to escape $ symbol

watch "ip -s link show enp65s0f0 | sed -n '/    vf 4/,\$p'"

Upvotes: 2

Related Questions