O'Reilly logo

Korn Shell: Unix and Linux Programming Manual, Third Edition, The by Anatole Olczak

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required