Question: when i run this script it give me one file to print must be specified i don't have printer can i run it without or
when i run this script it give me one file to print must be specified i don't have printer can i run it without or how to run this
#binbash # Program to print a text file with headers and footers # Usage: printfile file PROGNAME$basename $ # Create a temporary file name that gives preference # to the user's local tmp directory and has a name # that is resistant to tmp race attacks if d ~tmp; then TEMPDIR~tmp else TEMPDIRtmp fi TEMPFILE$TEMPDIR$PROGNAME.$$$RANDOM" usage # Display usage message on standard error echo "Usage: $PROGNAME file" & cleanup # Perform program exit housekeeping # Optionally accepts an exit status rm f $TEMPFILE" exit $ errorexit # Display error message and exit echo $PROGNAME: $:"Unknown Error"& cleanup trap cleanup SIGHUP SIGINT SIGTERM if $# ; then usage errorexit "one file to print must be specified" fi if f $; then errorexit "file $ cannot be read" fi pr $$TEMPFILE" errorexit "cannot format file" read p "Print file? yn: if $REPLY" y; then lpr $TEMPFILE" errorexit "cannot print file" fi cleanup
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
