Help with TERM script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help with TERM script
# 1  
Old 10-25-2005
Computer 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
# 2  
Old 10-26-2005
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
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

What script would I use to count the number of a term and its opposite?

Hello All, I am looking to write a script to count the number of a term and its opposite and create a new file with said list. I can get the terms to print to the file but only one or the other and not both. I tried this: grep -wi done */all.txt | grep -wiv done */all.txt > "filename" ... (5 Replies)
Discussion started by: mcesmcsc
5 Replies

2. Shell Programming and Scripting

awk based script to print the "mode(statistics term)" for each column in a data file

Hi All, Thanks all for the continued support so far. Today, I need to find the most occurring string/number(also called mode in statistics terminology) for each column in a data file (.csv type). For one column of data(1.txt) like below Sample 1 2 2 3 4 1 1 1 2 I can find the mode... (6 Replies)
Discussion started by: ks_reddy
6 Replies

3. UNIX for Dummies Questions & Answers

qvt term with windows xp

I.m using qvt term to convert my windows xp laptop to work with sun ultra 5 unix system but i can't connect - my settings are off and i can't figure it out - i have a feeling it is my serial port # the porgramm is asking for. Can someone tell me where i can find this number. thanks Christine (9 Replies)
Discussion started by: lucenta tire
9 Replies

4. Shell Programming and Scripting

killproc -term

Hi, I am trying the function killproc -term and it seems to be doing something extra that kill <pid> doesn't do. My daemon cleanly terminates using kill, but not using killproc. I tried strace on killproc and then killproc works well. I read online that strace ignores SIGSTOP. does that mean... (4 Replies)
Discussion started by: fosfat
4 Replies

5. Shell Programming and Scripting

Testing for TERM type

There are times where I want to use putty(vt100 TERM) and hummingbird (XTERM) is there a way to test what terminal connection I am using in my .profile so I can set my commands like stty erase correctly. (4 Replies)
Discussion started by: BeefStu
4 Replies

6. Shell Programming and Scripting

Remove last character of a term

Hi All, I have a few terms with a comma as the last character. Can any experts show me how to remove the last character? Note the the length of the term is not fix. Input: 1, 2, 12, 14, 103, 198, 3006, Output, 1 (6 Replies)
Discussion started by: Raynon
6 Replies

7. Shell Programming and Scripting

Search term and output term in desired field

Hi All, I have an input_file below and i would like to use Perl to search for the term "aaa" and output the 3rd term in the same row as "aaa".For Example, i want to search for the term "ddd" and would want the code to ouput the 3rd term in the same row which is "fff". Can somebody help ? ... (28 Replies)
Discussion started by: Raynon
28 Replies

8. Programming

Create a Term & Run chars on this Term

hi floks ! i'd like to know how can i transmete a character or a string from my source code to a term and make it interpret or un by the shell wich is running in my term. I'd like to create a Term from my code (and get its file descriptor) and then transmete each char typed on the keyboard to... (1 Reply)
Discussion started by: the_tical
1 Replies

9. UNIX for Dummies Questions & Answers

X-Term for Windows

Hi Everyone, I need some information from all of you guys. I generally work on a Solaris OS in my school and I had heard that I can download something called X-Term on a Windows system and still work on some of the graphical things on windows which generally work only on unix. This is what I... (5 Replies)
Discussion started by: yelamarthi
5 Replies

10. UNIX for Dummies Questions & Answers

Setting TERM variable

Does anybody know how to give a default TERM variable while telnetting to Solaris (1 Reply)
Discussion started by: DPAI
1 Replies
Login or Register to Ask a Question