Help for this page

Select Code to Download


  1. or download this
    perl -i.old -lne 'if (/^[\s#]*Port/i) { print "Port 1234" unless $done
    +++ } else { print }' sshd_config
    
  2. or download this
    perl -i.old -lne 'print unless /^[\s#]*Port/i; END{print "Port 1234"}'
    + sshd_config
    
  3. or download this
    PORT=1234 perl -i.old -lne 'print unless /^[\s#]*Port/i; END { print "
    +Port $ENV{PORT}" }' sshd_config
    
  4. or download this
    perl -i.old -lne 'BEGIN { $sshport = pop }; print unless /^[\s#]*Port/
    +i; END { print "Port $sshport" }' sshd_config 1234