awk -F= '/config.*cacti_version.*=/{gsub(/(\ |\"|;)/,"",$2);print $2}' /var/www/cacti/include/global.php
How to chkconfig off multiple services with bash.
IN="atd auditd avahi-daemon avahi-dnsconfd bluetooth clvmd cman conman cpuspeed cups dnsmasq dund gfs gfs2 gpm ip6tables iptables irda irqbalance kdumpkudzu mcstrans mdmonitor mdmpd microcode_ctl netconsole netplugd nscd ntpd oddjobd openais pand pcscd psacct qdiskd rawdevices rdisc readahead_early readahead_later restorecond sendmail setroubleshoot tcsd vncserver wdaemon wpa_supplicant xfs ypbind yum-updatesd" arr=$(echo $IN | tr " " "\n") for x in $arr do /sbin/chkconfig $x off &>/dev/null || echo -e "\033[1m * Service $x not exists\033[0m" done