#!/bin/sh -u # demonstrate the use of the shell "read" built-in command # ----- # Syntax: $0 # ----- # Purpose: # Prompt for a file name and a userid. # Display the given filename on the terminal of the given userid. # ----- # Student Name: Ben Dover # Algonquin EMail Address: abcd0001 # Student Number: 074-210-779 # Course Number: NET2003 # Lab Section Number: 014 # Professor Name: Ian Allen # Assignment Name/Number/Date: Exercise 3.1416 due July 31, 2023 # ----- # -IAN! idallen@idallen.ca # Use standard search path, friendly umask, ASCII collating and sorting. # PATH=/bin:/usr/bin ; export PATH umask 022 LC_COLLATE=C ; export LC_COLLATE # prompt on stderr and read the file name and userid from standard input # echo 1>&2 "$0: Enter a file name and a userid on one line:" read filename userid # send the file to the given userid # write "$userid" <"$filename" # The script exits with the return status of the last command executed.