LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris and OpenSolaris.
General Sun, SunOS and Sparc related questions also go here.

Notices

Reply
 
Search this Thread
Old 10-11-2011, 09:33 AM   #1
rajsp217
LQ Newbie
 
Registered: Jun 2011
Posts: 12

Rep: Reputation: Disabled
Question 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
 
Old 10-11-2011, 10:15 AM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,490

Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
Where is the "following shell script" ?
 
Old 10-11-2011, 10:17 AM   #3
rajsp217
LQ Newbie
 
Registered: Jun 2011
Posts: 12

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jlliagre View Post
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
 
Old 10-11-2011, 10:26 AM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,490

Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
Your script is missing "stty echo" before each exit instructions.
 
Old 10-13-2011, 06:26 AM   #5
rajsp217
LQ Newbie
 
Registered: Jun 2011
Posts: 12

Original Poster
Rep: Reputation: Disabled
Thumbs up

Quote:
Originally Posted by jlliagre View Post
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
 
Old 10-13-2011, 06:55 AM   #6
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,490

Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
"stty echo" reverse the effect of "stty -echo" which disable typed characters to be displayed.
 
Old 10-13-2011, 06:56 AM   #7
rajsp217
LQ Newbie
 
Registered: Jun 2011
Posts: 12

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jlliagre View Post
"stty echo" reverse the effect of "stty -echo" which disable typed characters to be displayed.
Thanks again!!!!


Raj
 
  


Reply

Tags
shell script


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Executing a Shell script with 654 permissions inside another shell script. changusee2k Linux - Newbie 2 06-07-2011 07:58 PM
putty script gratefulhemp *BSD 1 03-05-2007 03:36 PM
shell script problem, want to use shell script auto update IP~! singying304 Programming 4 11-29-2005 05:32 PM
Which script is corrupting my path? robertmarkbram Linux - Software 1 05-03-2004 04:40 AM


All times are GMT -5. The time now is 01:21 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration