Home Tags Archives About me Rss

If Else In Sed

If-else statement in linux command sed

use t or T to control the sed workflow.(more)

1
2
sed -i "s/animations = true/animations = false/;t;\
    s/animations = false/animations = true/" "$picom_config"

Reference

  1. How to toggle a comment in a line using sed
  2. Sed/Branching-and-flow-control