1. Linux
1.1. Delete all text between nested curly brackets in a multiline text file
-
Enter the following commands at a Command Line.
cat psm1/Routines.psm1 | \ sed -e '/^<#.*#>/d' | \ sed -e '/^<#/,/^#>/s/.*//' | \ sed -e 's/#.*//' | \ sed -e '/ @"\r$/,/^"@/s/.*//' | \ sed -e "/ @'\r$/,/^'@/s/.*//" | \ sed ':again;$!N;$!b again; :b; s/{[^{}]*}//g; t b' | \ sed -e 's/^M//' | \ grep -iv 'Export-ModuleMember' | \ grep -Eiv '^$|^ $|^ $' | \ more