Operating System - HP-UX
1836462 Members
1957 Online
110101 Solutions
New Discussion

Re: need simple script help w/ read

 
LorI Szabo
Occasional Contributor

need simple script help w/ read

my scripting is very weak and we do not have a full time or even part time admin.

I need to ask from a script a persons First Name Last Name and change control number and route this reply/answer to a log file. I think I would use read?

Like
Lori Szabo 0519887

Can any one help.
1 REPLY 1
A. Clay Stephenson
Acclaimed Contributor

Re: need simple script help w/ read

#!/usr/bin/sh

LOGFILE="mylog.log"

echo "Enter First Name: \c"
read FNAME
echo "Enter Last Name : \c"
read LNAME
echo "Enter Change Control No. : \c"
read CCNUM

DT=$(date)
echo "Time: ${DT} ${FNAME} ${LNAME} ${CCNUM}" >> ${LOFGILE}
If it ain't broke, I can fix that.