diff options
author | Tom Willemsen | 2011-03-07 09:04:49 +0100 |
---|---|---|
committer | Tom Willemsen | 2011-03-07 09:04:49 +0100 |
commit | 94d2fc1815a919734353c942f224db1de4b4fcb8 (patch) | |
tree | 4168e816ead132bfa3510e272427837c3895f5e2 /emacs.d/nxhtml/tests/in/question49234.sh | |
parent | d0e7674fdb1de12c8de202d4028a5d7ed3669a6e (diff) | |
download | dotfiles-94d2fc1815a919734353c942f224db1de4b4fcb8.tar.gz dotfiles-94d2fc1815a919734353c942f224db1de4b4fcb8.zip |
Django, org
* Added nxhtml, mostly for django support.
* Changed some org settings.
Diffstat (limited to 'emacs.d/nxhtml/tests/in/question49234.sh')
-rw-r--r-- | emacs.d/nxhtml/tests/in/question49234.sh | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/emacs.d/nxhtml/tests/in/question49234.sh b/emacs.d/nxhtml/tests/in/question49234.sh new file mode 100644 index 0000000..3596046 --- /dev/null +++ b/emacs.d/nxhtml/tests/in/question49234.sh @@ -0,0 +1,41 @@ +#!/bin/ksh +. /bin/shared/.mkt.cfg + + +STORE_TMP=/tmp/stores.txt +cd /spool/xml + +rm -f $STORE_TMP + +bteq << EOF +.SESSIONS 1 +.LOGON $UserId,$Password; + +.EXPORT DATA FILE "$STORE_TMP" +select division_id,store_id, +trim(store)||' '||trim(store_addr_line2_txt)||', '|| +trim(store_city) +from stores +where status_id='A' + and division_id in (517,1920,2445) +order by division_id,store_city,store_id; + +.EXIT 0 +EOF + +perl <<EOF > $1 +print qq(<?xml version="1.0" encoding="utf-8"?>\n<stores>); +open IN, '<$STORE_TMP'; +while (read IN,\$info, 12) { + my (\$div, \$s) = unpack 'x2 i i', \$info; # read binary nums + \$_ = <IN>; # Read store name + chop; # Remove newline + s/(\w+)/\u\L\$1/g; # Title case + s/&/&/g; # Fix ampersands + s/"/"/g; # Fix quotes + printf qq(<s d="%02d" i="%d" n="%s"/>\n),\$div,\$s,\$_; +} +print "</stores>"; +EOF + +rm $STORE_TMP |