Interactive uucp - kuucp

Here is an interactive version of the uucp command. Instead of looking for a system name in the uucp systems file using grep, the remote system name is verified by using file I/O substitution and Korn shell patterns.

					#!/bin/ksh
					#
					#     kuucp - Korn shell interactive uucp
					#
					# Check usage
					if (($# > 0))
					then
					print "Usage: $0"
					exit 1
					fi
					# Set variables
					PUBDIR=${PUBDIR:-/usr/spool/uucpublic}
					# This sets UUSYS to the contents of the HDB-UUCP
					# Systems file. It may be different on your system.
					UUSYS=$(</usr/lib/uucp/Systems)
					# Get source file
					read SOURCE?"Enter source file: "
					# Check source file
					if [[ ! -f $SOURCE ]]
					then
					print "$SOURCE: non-existent or not accessible"
					exit 2
					fi
					# Get remote system name
					read RSYS?"Enter remote ...

Get Korn Shell: Unix and Linux Programming Manual, Third Edition, The now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.