SquirrelJME/SquirrelJME

View on GitHub
utils-dev/myname.sh

Summary

Maintainability
Test Coverage
#!/bin/sh
# ---------------------------------------------------------------------------
# Multi-Phasic Applications: SquirrelJME
#     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
#     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
# ---------------------------------------------------------------------------
# SquirrelJME is under the GNU General Public License v3, or later.
# See license.mkd for licensing and copyright information.
# ---------------------------------------------------------------------------
# DESCRIPTION: Returns the blog friendly username

# Force C locale
export LC_ALL=C

# Directory of this script
__exedir="$(dirname -- "$0")"

# Current user
__myname="$(fossil user default 2> /dev/null)"
if [ -z "$__myname" ]
then
    __myname="$USER"
fi

# Print it, convert any dots to dashes
echo "$__myname" | sed 's/\./-/g'