Skip to content

Instantly share code, notes, and snippets.

@yan-kisen
Created May 20, 2015 19:03
Show Gist options
  • Save yan-kisen/6856ecacdb3df74e6e74 to your computer and use it in GitHub Desktop.
Save yan-kisen/6856ecacdb3df74e6e74 to your computer and use it in GitHub Desktop.
Create Batch CQ5 Tags
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:description=""
jcr:primaryType="cq:Tag"
jcr:title="DIRNAME"
sling:resourceType="cq/tagging/components/tag"/>
#!/bin/bash
n=1880
max=2015
while [ "$n" -le "$max" ]; do
echo $n
mkdir -p $n
cat content.xml.template > $n/.content.xml
sed -i '' 's/DIRNAME/'${n}'/g' $n/.content.xml
n=`expr "$n" + 1`;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment