How can I extract a word that comes after a specific word in Linux (csh)? More precisely, I have a file which has a single line which looks like this:
[so
You can use sed. Just make a group of want you want to match and replace the whole line with the group:
sed -n 's/^.*pe_cnt\s\+\([0-9]\+\).*$/\1/p' file