Call Binary From Bash Script

CLKF Course Strip out Comments and Blank Lines with Grep LinuxUnix

Use the following grep command to strip outcomments and blank lines $ grep Ev quot;^|^$quot; file The E options enables extended regular expressions.This allows us to use the pipe to represent the quot;orquot; condition in our pattern. The v option inverts thematch meaning that grep will only print lines that do not match our search pattern. Thequot;^quot; pattern matches all lines that begin with a pound sign () while the quot;^$quot; patternmatches all the blank lines. jason@linuxsvr etc$ head etcsysctl.conf Kernel sysctl configuration file for Red Hat Linux

For binary values, 0 is disabled, 1 is enabled.See sysctl(8) and sysctl.conf(5) for more details. Controls IP packet forwardingnet.ipv4.ip_forward = 0 Controls source route verificationnet.ipv4.conf.default.rp_filter = 1 jason@linuxsvr etc$ grep Ev '^|^$' sysctl.confnet.ipv4.ip_forward = 0 net.ipv4.conf.default.rp_filter = 1net.ipv4.conf.default.accept_source_route = 0kernel.sysrq = 0 kernel.core_uses_pid = 1net.ipv4.tcp_syncookies = 1

net.bridge.bridgenfcallip6tables = 0net.bridge.bridgenfcalliptables = 0 net.bridge.bridgenfcallarptables = 0kernel.msgmnb = 65536 kernel.msgmax = 65536kernel.shmmax = 4294967295 kernel.shmall = 268435456jason@linuxsvr etc$.

Leave a Reply