Remove chkconfig header from output
问题 On my CentOS machine I wrote a script which tells me whether a service is installed or not. Here is the script count=$(chkconfig --list | grep -c "$1") if [ $count = 0 ]; then echo "False" else echo "True" fi The problem is that the output of the command always includes the starting lines of the chkconfig output. For example here is the output of script.sh network [root@vm ~]# ./script.sh network Note: This output shows SysV services only and does not include native systemd services. SysV