第一步:把要执行命令的样子显示出来
[[email protected] ~]# chkconfig|egrep "sshd|crond|rsyslog|network|sysstat"|sed -r ‘s#(^.*)0.*#chkconfig \1 on#g‘
chkconfig crond on
chkconfig network on
chkconfig rsyslog on
chkconfig sshd on
chkconfig sysstat on
第二步:把要执行命令的样子显示出来并且执行
[[email protected] ~]# chkconfig|egrep "sshd|crond|rsyslog|network|sysstat"|sed -r ‘s#(^.*)0.*#chkconfig \1 on#g‘|bash
第三步:查看执行的结果
[[email protected] ~]# chkconfig|grep 3:on
crond 0:off 1:off 2:on 3:on 4:on 5:on 6:off
network 0:off 1:off 2:on 3:on 4:on 5:on 6:off
rsyslog 0:off 1:off 2:on 3:on 4:on 5:on 6:off
sshd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
sysstat 0:off 1:on 2:on 3:on 4:on 5:on 6:off
时间: 2024-12-08 20:59:59