Help with TERM script

I am trying to amend an existing TERM script to prompt the end user for a password - then take that password and add it to a specific part of an existing file.

Here is what I have - BUT - I am confusing Unix with Term and my script does not like what I added b/c the script simply runs through and returns the user to a $. (Notice that the password is added in the second from the last line)

  • Can anyone help me translate this shell script to TERM?? - Thanks in Advance!!!

echo "Changing Password for All Medicare Scripts"
echo "Password MUST be 8 characters in length"
echo "MUST contain BOTH letters and numbers (any combo totaling 8)"
echo "Password MUST be entered in lower case (NO Capital Letters)"
echo "Password CANNOT be the LoginID (PRJ Number)"
echo "MUST be changed periodically (30/60/90 Days is preferred)"
echo "Enter New Password Request:"
read newpswd

rm /usr/term/pa08fps.old
cp /usr/term/pa08fps.con /usr/term/pa08fps.old
rm /usr/term/pa08fps.con
> /usr/term/pa08fps.con

echo "xprot ZMODEM" >> /usr/term/pa08fps.con
echo "set view on" >> /usr/term/pa08fps.con
echo "set echo on" >> /usr/term/pa08fps.con
echo "!dinit \"AT&FV1E0M1Q0S7=60\\r\"" >> /usr/term/pa08fps.con
echo "login \"^SN:^Slogin\r^SD:^S$newpswd\\r\""
echo "capture disk /dev/null overwrite" >> /usr/term/pa08fps.con

I don't know term, but I know shell scripts. I think you have an error, where you forgot to save the login/password information:

echo "login \"^SN:^Slogin\r^SD:^S$newpswd\\r\"" >> /usr/term/pa08fps.con

Also, to clean your script up, rather than doing the rm-cp-rm-createfile shuffle, just do this:

cp /usr/term/pa08fps.con /usr/term/pa08fps.old
echo "xprot ZMODEM" > /usr/term/pa08fps.con # notice the single >
# The rest of your echo statements will use >>

Now, the last thing is: by the end of this script you have created a file. What do you want to do with it? Since you don't say, your users will get their $ after running this script. You have to do something with your /usr/term/pa08fps.con. Perhaps,

 term /usr/term/pa08fps.con

...or something like command /usr/term/pa08fps.con