[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] [off-list] document(lang_*.xml)
Jarkko.Moilanen@xxxxxx wrote: > So there is no root level element, how do I add it there? Most every shell uses '>' to redirect (creating/overwriting the destination), and '>>' to append (raising an error if the destination does not exist). Some shells have a 'noclobber' option that controls whether or not '>' will overwrite an existing file or raise an error. How you set this option depends on what shell you're using. #!/bin/sh implies Bourne shell, but on some Linux systems they've replaced it with Bourne Again shell (bash), which was not a good idea, in my opinion. 'man sh' or 'man bash' will give you all the details. Anyway... echo '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' > list.xml echo '<LangList>' >> list.xml ls lang_*.xml | sed -e "s@\(.*xml\)@<language>\1</language>@" >> list.xml echo '</LangList>' >> list.xml Instead of 'ls', you might want to do '/bin/ls -1'. Many people create personal aliases for 'ls' that change the list format. By explicitly specifying /bin/ls, you avoid using the alias. The -1 forces the output to be one filename per line, in case the default on your system is multicolumn. XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|