mirror of
https://gitlab.com/shorewall/code.git
synced 2025-06-24 19:51:40 +02:00
More beautification of the generated script
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@4779 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
5015d66dec
commit
4d6cf619fe
@ -4907,12 +4907,20 @@ __EOF__
|
|||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# Post-process generated script
|
# Post-process generated script to:
|
||||||
|
#
|
||||||
|
# - Suppress redundant blank lines
|
||||||
|
# - Replace leading spaces with tabs
|
||||||
#
|
#
|
||||||
mycat()
|
mycat()
|
||||||
{
|
{
|
||||||
if [ -n "$(mywhich awk)" ]; then
|
local awk=$(mywhich awk)
|
||||||
awk 'BEGIN {blnk=0;}; /^\s*$/ {blnk=1; next; }; { if (blnk == 1 ) { print ""; blnk=0; }; print; }' $*
|
|
||||||
|
if [ -n "$awk" ]; then
|
||||||
|
$awk 'BEGIN {blnk=0;}; \
|
||||||
|
/^\s*$/ {blnk=1; next; }; \
|
||||||
|
{ while (/^\t* /) sub(/ /, "\t" ); }; \
|
||||||
|
{ if (blnk == 1 ) { print ""; blnk=0; }; print; }' $*
|
||||||
else
|
else
|
||||||
cat $*
|
cat $*
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user