#!/usr/bin/env bash

# Analogous to pwd, but gives the "web working directory", i.e., the
# path information to reach the pwd in a www .html file.

# Might want to soup this up to add a check for an argument directory
# that would be converted instead of pwd.

pwd -P | sed 's+.*/\([^/]*\)/'${WEB_USER_DIR:-public_html}'+/~\1+' | sed 's+^/'${WEB_USER_DIR:-public_html}'/+/~'$USER'/+'
