How do I add multiple "+" commands into less from the command line

I don't think I understand the first part of your question based on your later comments. For me, using less +F +/pattern logfile works and continues to highlight new instances of pattern as they appear in the updated file.

As for the bonus part of your question, you can try one of the following commands:

less +\&DHCP$'\n' /var/log/syslog

or

less +\&DHCP^M /var/log/syslog

In that second command the ^M is generated by pressing Ctrl-V then Enter. Kinda easier to just press enter when less starts though unless you're looking to script it or something.


And on the massive overcomplication front: auto-tail with changeable search terms via an expect wrapper!

#!/usr/bin/env expect
#
# Sticky search wrapper for less; tails the given file, though with
# input of
#   /asdf
# or whatever will search for that new term then re-tail the file.
# Probably needs `less` with (the default) hilight mode enabled.

if {[llength $argv] == 0} {
  puts stderr {Usage: $argv0 [searchterm] file}
  exit 64
} elseif {[llength $argv] == 1} {
  set fname [lindex $argv 0]
  set search ""
} else {
  set fname [lindex $argv 1]
  set search [lindex $argv 0]
}

# FIXME soas to nix any default options (like turning off hilight) and
# on account of LESSOPEN and LESSCLOSE being security risks due to the
# defaults certain vendors set.
foreach ev [list LESS LESSOPEN LESSCLOSE] {
  if {[info exists env($ev)]} {
    unset env($ev)
  }
}

match_max 999
set timeout -1

spawn -noecho less $fname
expect {
  # TODO need better way to detect that less didn't fly...
  -ex "No such file or directory" { exit }
  -re "." { }
  default { exit }
}

if {$search ne ""} {
  send -- "/$search\r"
}
send -raw "F"
interact {
  -echo -re "/(.*)\[\n\r]" {
#   send_user "DBG search $interact_out(1,string)"
    send -raw "\003\r/"
    send -- $interact_out(1,string)
    send -raw "\rF"
  }
}