Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #/bin/bash
- sed_prg=\
- $(cat <<EOF
- $,/.*/ {
- H #Append new data to hold space
- x #Exchange hold space with pattern space
- s/<!--.*-->//g #Delete comment
- p #Print pattern space
- }
- #If we don't yet have a terminating comment just append to the hold space and start the next cycle.
- /.*-->.*/! {
- H #Append pattern space to hold space
- d #Delete pattern space and start next cycle
- }
- #If we have a closing comment append data to hold space and copy the hold space to the pattern space to see if we can match both an opening and closing comment in pattern space.
- /.*-->.*/ {
- H #Append new data to hold space
- x #Exchange hold space with pattern space
- h #Copy pattern space to hold space
- }
- #If this block matches the previous block has already been executed and this block will be executed next.
- /.*<!--.*-->.*/ {
- s/<!--.*-->//g #Delete comment
- p #Print pattern space
- s/.*//g #delete pattern space
- x #exchange pattern space with hold space
- d #delete pattern space and start next cycle.
- }
- EOF
- )
- #echo "$sed_prg"
- sed_input=\
- $(cat <<EOF
- <JWM>
- <Tray autohide="false" insert="right" x="0" y="-1" border="1" height="28" >
- <!-- Additional TrayButton attribute: label -->
- <TrayButton label="Menu" icon="logo-mini.png" border="true">root:3</TrayButton>
- border="true">exec:urxvt</TrayButton>
- <Pager/>
- <!-- Additional TaskList attribute: maxwidth -->
- <TaskList maxwidth="200"/>
- <Dock/>
- <!-- Additional Swallow attribute: height -->
- <!-- <Swallow name="blinky">
- blinkydelayed -bg "#DCDAD5"
- </Swallow> -->
- <!-- <Swallow name="xtmix-launcher">
- xtmix -launch
- </Swallow> -->
- <!-- <Swallow name="asapm">
- asapmshell -u 4
- </Swallow> -->
- <!-- <Swallow name="freememapplet" width="34">
- freememappletshell
- </Swallow> -->
- <Swallow name="xload" width="32">
- xload -nolabel -bg "#888888" -fg red -hl white
- </Swallow>
- <Clock format="%H:%M">minixcal</Clock>
- </Tray>
- </JWM>
- EOF
- )
- #echo "$sed_input"
- echo "$sed_input" | sed -n "${sed_prg}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement