# get_version - Get the version of the admin, doc, and license directories.
#
# Version 1.3
#
# Post:
#    get_version - abbreviated directory version (e.g., "1.3b2")
#    get_version_d - full directory version (e.g., "1.3 Beta 2")
#    get_version_n - numeric directory version (e.g., "1022")
#
# This routine is sourced from csh.
#
# Copyright (c) 1995 by
#
#    Confluent, Inc.
#    400 Spear St., Suite 207
#    San Francisco, CA 94105
#
# Voice: 415-764-1000
# Fax: 415-764-1008
# Internet: info@confluent.com
#
# Created: 950116 - jag
# Modified: 950314 - jag : Disable interrupts
# Modified: 950422 - jag : Determine get_version_* from get_version

# Disable interrupts in case they are disabled in the sourcing script.
onintr -

# Set the abbreviated version.
set get_version = "1.4"

# Generate the full version from the abbreviated version.
set get_version_d = `echo $get_version | sed -e 's/b/ Beta /'`

# Generate the numeric version from the abbreviated version.
# x.y   => x * 1000 + 10 * y
# x.ybz => x * 1000 + 10 * y + (z - 10)
set gv_temp = (`echo "$get_version 0" | sed -e 's/[.b]/ /g'`)
if ($gv_temp[3] > 0) @ gv_temp[3] -= 10
@ get_version_n = 1000 * $gv_temp[1] + 10 * $gv_temp[2] + $gv_temp[3]
