Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Problem in Unix script to exit from Putty Post 302589977 by ctsgnb on Friday 13th of January 2012 09:01:08 AM
Old 01-13-2012
also execute your script this way (dot space <yourscript>) like :
Code:
. ./yourscript

here is a quick example you can try :
Code:
$ echo "exit" >mytst
$ chmod +x mytst
$ cat mytst
exit
$ ./mytst
$ sh ./mytst
$ . ./mytst

The last command will exit the terminal session you are in




Also note that the persistence of PuTTY windows can be tweaked in PuTTY configuration :
Menu : "Session"
Frame : "Close window on exit"
-Always
-Never
-Close on exit

... just choose the option you need

Last edited by ctsgnb; 01-13-2012 at 10:08 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

changing shells in unix (im using putty)

hi. im new here. im taking a UNIX OS class and im in need of some help how do i change my shell in UNIX? for homework i need to edit the tcshrc file (to include aliases) in my home directory but its not there. so i think switching shells will create the file. am i correct? I'm using PuTTy.... (1 Reply)
Discussion started by: alpha_centauri
1 Replies

2. UNIX for Dummies Questions & Answers

reg putty problem

Hi, i am using PUTTY 0.51 release for connecting the Red hate linux box in SSH mode. its working fine but i can't able to scoll the scoll bar using scroll wheel inthe mouse. please suggest me how to solve it. thanks in advance. thanks and regards, ilayans (2 Replies)
Discussion started by: ilayans
2 Replies

3. UNIX for Dummies Questions & Answers

Problem with putty and password

I am using putty to ssh into my linux machine, I followed the steps to create password less authentication. 1. generated both private and public key 2. copied the public key over to the ~/.ssh/authorized_keys file 3. loaded Private key with pagent (when it didnt work i used Auth in Putty to... (2 Replies)
Discussion started by: bensen
2 Replies

4. Shell Programming and Scripting

problem in exit status of the command in a shell script-FTP

Hi All, I have developed below script for FTP a file from unix machine to another machine. ftpToABC () { USER='xyz' PASSWD='abc' echo "open xx.yy.zbx.aaa user $USER $PASSWD binary echo "put $1 abc.txt" >> /home/tmp/ftp.$$ echo "quit" >> /home/tmp/ftp.$$ ftp -ivn <... (3 Replies)
Discussion started by: RSC1985
3 Replies

5. Shell Programming and Scripting

PUTTY via UNIX script

HELP!!!! I want to execute a PUTTY telnet connection via UNIX script??? Any help please?? Thanks (1 Reply)
Discussion started by: tontal
1 Replies

6. UNIX for Advanced & Expert Users

Unix user with root power problem in to login in putty

Hello, I created a user in my AIX 5.3 system and i modified /etc/passwd file in and assigned this user the uid=0 like root user. The problem is that when this user log into the system through putty it asks for root password instead of the user password. As a result of this, if i reset the... (4 Replies)
Discussion started by: omonoiatis9
4 Replies

7. Shell Programming and Scripting

Exit code from piping in unix shell script

Hi , I have following code in my shell script : "$TS_BIN/tranfrmr" "${TS_SETTINGS}/tranfrmr_p1.stx" "${TS_LOGS}/tranfrmr_p1.err" | ( "$TS_BIN/cusparse" "${TS_SETTINGS}/cusparse_p2.stx" "${TS_LOGS}/cusparse_p2.err" | ( "$TS_BIN/tsqsort" "${TS_SETTINGS}/srtforpm_p3.stx"... (8 Replies)
Discussion started by: sonu_pal
8 Replies

8. Shell Programming and Scripting

How to exit a shell script if a unix command does not return any value for 10 seconds?

Hi, Can anyone help me how to exit a shell script if a unix command inside does not return any value for 10 seconds? The scenarios is like this. I want to login to a application using shell script where the connection string is mentioned.but suppose this connection string is not... (10 Replies)
Discussion started by: arijitsaha
10 Replies

9. Windows & DOS: Issues & Discussions

Connecting to UNIX from Windows without using putty

Hi Is there any command which we can try connecting unix from windows without using any third party tool. Thanks in advance KVB (9 Replies)
Discussion started by: bikky6
9 Replies

10. Shell Programming and Scripting

Make expect exit the UNIX script in erreneous condition

Hi, I am writing a menu driven program using shell script. THe script will be collecting data by logging into the other servers and bringing back the data to home server to process it and accordingly issue commands. TO automate commands execution , I am using expect script. However I am not able... (5 Replies)
Discussion started by: ashima jain
5 Replies
mitem_value(3X) 														   mitem_value(3X)

NAME
mitem_value - set and get menu item values SYNOPSIS
#include <menu.h> int set_item_value(ITEM *item, bool value); bool item_value(const ITEM *item); DESCRIPTION
If you turn off the menu option O_ONEVALUE (e.g., with set_menu_opts or menu_opts_off; see menu_opts(3X)), the menu becomes multi-valued; that is, more than one item may simultaneously be selected. In a multi_valued menu, you can used set_item_value to select the given menu item (second argument TRUE) or deselect it (second argument FALSE). RETURN VALUE
The function set_item_value returns one of the following: E_OK The routine succeeded. E_SYSTEM_ERROR System error occurred (see errno). E_REQUEST_DENIED The menu driver could not process the request. SEE ALSO
curses(3X), menu(3X). NOTES
The header file <menu.h> automatically includes the header file <curses.h>. PORTABILITY
These routines emulate the System V menu library. They were not supported on Version 7 or BSD versions. AUTHORS
Juergen Pfeifer. Manual pages and adaptation for new curses by Eric S. Raymond. mitem_value(3X)
All times are GMT -4. The time now is 05:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy