$ b=$(pwd)
$ echo $b
/home/user1
Soure: http://stackoverflow.com/a/10948354
Rendering data into a template is easy.
#! /bin/bash
version="1.2.3"
path="/foo/bar/baz"
cat > /tmp/destfile <<-EOF
here is some config for version $version which should
also reference this path $path
EOF
Source: http://serverfault.com/a/287690
Use the --data-urlencode
switch.