LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Solaris / OpenSolaris (http://www.linuxquestions.org/questions/solaris-opensolaris-20/)
-   -   shell script corrupting Putty (http://www.linuxquestions.org/questions/solaris-opensolaris-20/shell-script-corrupting-putty-907587/)

rajsp217 10-11-2011 09:33 AM

shell script corrupting Putty
 
I am using following shell script for sending email.
Script works fine. But once I execute it, that putty session gets corrupted. Then I have to open any putty session.
I am not getting why this issue is happening.

Please help me on this ...


Regards,
Raj

jlliagre 10-11-2011 10:15 AM

Where is the "following shell script" ?

rajsp217 10-11-2011 10:17 AM

Quote:

Originally Posted by jlliagre (Post 4495577)
Where is the "following shell script" ?

Sorry I not pasted the script.
Here is the script

=====================
echo "SCRIPT TO MAIL A FILE TO emailid@xyz.com"
echo "Enter FILENAME : \c"
stty -echo
read V_FILENAME

P_SUBJECT=`echo "$1"|cut -d'"' -f8`
P_MAIL_TO=`echo "$1"|cut -d'"' -f12`
P_FILE=`echo "$1"|cut -d'"' -f14`
#
echo EMAILING FILE echo $V_FILENAME
uuencode "$V_FILENAME" "$V_FILENAME"|mailx -s "$V_FILENAME" emailid@xyz.com
if [ $? -ne 0 ]
then
echo ""
echo "Fail to send mailto ${P_MAIL_TO} with mail subject ${P_SUBJECT}"
echo ""
exit 1
fi
exit 0
=================


Thanks,
Raj

jlliagre 10-11-2011 10:26 AM

Your script is missing "stty echo" before each exit instructions.

rajsp217 10-13-2011 06:26 AM

Quote:

Originally Posted by jlliagre (Post 4495581)
Your script is missing "stty echo" before each exit instructions.

Thanks, It "stty echo" solved the issue.
But I did not get how it resolved the issue. I am novice in Linux.


Thanks,
Raj

jlliagre 10-13-2011 06:55 AM

"stty echo" reverse the effect of "stty -echo" which disable typed characters to be displayed.

rajsp217 10-13-2011 06:56 AM

Quote:

Originally Posted by jlliagre (Post 4497351)
"stty echo" reverse the effect of "stty -echo" which disable typed characters to be displayed.

Thanks again!!!!


Raj


All times are GMT -5. The time now is 03:07 AM.