#!/usr/bin/perl -Tw
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
#NAME
#  _ [pathname]
#
#SYNOPSIS
#  path [file]..
#
#REQUIRES
#
#DESCRIPTION
# This strip the directories from each pathname, and creates (via touch) a
# file by that name in the local _ directory.  This is used by some software
# to say that files by that name should be made to stand out in listings
# by displaying them in a bold font.
#
# The idea is to not waste as much time copying the filename and then
# pasting it into the _ directory by hand.
#
#OPTIONS
#
#EXAMPLES
#
#FILES
#
#BUGS
#
#SEE ALSO
#
#AUTHOR
#  John Chambers <jc@trillian.mit.edu> 20241007
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #

$| = 1;
$exitstat = 0;
($P = $0) =~ s".*/"";
$V = $ENV{"V_$P"} || $ENV{"D_$P"} || 2;	# Verbose level.

print "$P: V=$V.\n" if $V>1;

for $path (@ARGV) {
	print "$P: path=\"$path\"\n" if $V>1;
	if (-f $path) {
		$path =~ s"/+$"";		# discard final slashes.
		print "$P: path=\"$path\"\n" if $V>1;
		if (($dnam,$fnam) = ($path =~ m"^\(.*\)\/(.*)$")) {
			print "$P: 1 = '$1'\n";
			print "$P: 2 = '$2'\n";
			$dnam = $1 | '';
			$fnam = $2 | '';
			print "$P: dnam=\"$dnam\" fnam=\"$fnam\"\n"; # if $V>1;
		} else {
			$fnam = $path;
			print "$P: [no dnam] fnam=\"$fnam\"\n";
		}
	} else {
		print "$P: \"$path\" isn't a file name.\n"; # if $V>1;
	}
}

print "$P: Exit with status $exitstat.\n"; # if $V>1;
exit $exitstat;

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
