Subject: [xsl] [off-list] document(lang_*.xml) From: Mike Brown <mike@xxxxxxxx> Date: Sat, 25 Jan 2003 04:45:12 -0700 (MST) |
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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] document(lang_*.xml)?, Jarkko . Moilanen | Thread | RE: [xsl] [off-list] document(lang_, Roger Glover |
Re: [xsl] document(lang_*.xml)?, Jarkko . Moilanen | Date | Re: [xsl] document(lang_*.xml)?, Mike Brown |
Month |