Are you looking for something like this:
Code:
awk -F" sh" '/sh/{ print $2 }' infile
-c "ping -c 3 172.18.47.1"
-c ifconfig
-c "ethtool eth1"
-c "cat /proc/cpuinfo"
-c "dmidecode -t system"
-c "dmidecode -t bios"
-c uptime
-c "cat /proc/meminfo"
-c "cat /p--More-- (24% of 5110 bytes)
-c "uname -a"
-c "cat /proc/cmdline"
-c "ls /usr/java/"
And although not perl/awk, here's also a sed solution:
Code:
sed -n 's%.*exec: sh%%p' infile
-c "ping -c 3 172.18.47.1"
-c ifconfig
-c "ethtool eth1"
-c "cat /proc/cpuinfo"
-c "dmidecode -t system"
-c "dmidecode -t bios"
-c uptime
-c "cat /proc/meminfo"
-c "cat /p--More-- (24% of 5110 bytes)
-c "uname -a"
-c "cat /proc/cmdline"
-c "ls /usr/java/"