perl -wpi -le '$_ .= "%" if m!^/index!' file