chkconfig 查找出第一列,开头不包含0的

chkconfig|egrep -o "^[^0]+"|egrep -v "sshd|network|crond|sysstat"

awk取

#for i in $(chkconfig|awk     '!/sshd|network|rysslog|crond/{print $1}')
#do
#     echo    "chkconfig $i off"
#don

egep不准确,第一个准
for i in $(chkconfig|egrep -o "^[a-z]+"|egrep -v "sshd|rsyslog|network|crond|sysstat")
do
 echo "chkconfig $i off"
done

sed方法取

chkconfig|sed -rn '/sshd|network|crond|rsyslog/!s#(.*)0:.*#\1#gp'

相关文章:

  • 2022-12-23
  • 2022-02-08
  • 2022-12-23
  • 2021-12-18
  • 2021-09-20
  • 2022-02-09
  • 2021-04-28
  • 2022-12-23
猜你喜欢
  • 2021-07-04
  • 2021-12-18
  • 2022-12-23
  • 2022-01-13
  • 2021-12-23
  • 2021-06-15
相关资源
相似解决方案