Script command - need help urgently


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script command - need help urgently
# 1  
Old 01-06-2010
Script command - need help urgently

I have added script command to the .profile of the id, whose session needs to be captured. When exit command is issued, the script command exits.
Is there a way to exit the parent shell also - and log off the system completely with one exit command?
# 2  
Old 01-06-2010
Start the script with exec.

Regards
# 3  
Old 01-06-2010
I am also executing a mail command after the script in the .profile, to send the output of script to the management - more like an audit report.
When exec is used, I find the mail is not sent. Gets terminated. Can someone please help.
# 4  
Old 01-06-2010
Why don't you place an exit command after the mail command?
# 5  
Old 01-06-2010
try this in the .profile:

Code:
. the_script

and then this should work in the_script:

Code:
date | mailx me
exit

oh.... and there may be something else wrong with the script?
# 6  
Old 01-06-2010
I did this - exec script....in .profile, then placed a mail command and then an exit. There also, when I type an exit, the parent process exits, no mail is being sent.
I removed the exec and tried the same thing. The system just hangs when i type an exit.
Please help!!!

---------- Post updated at 11:39 AM ---------- Previous update was at 11:37 AM ----------

Where do I execute the script command in the .profile? Should I be doing an exec script before executing the_script? Kindly help.
# 7  
Old 01-06-2010
Quote:
Originally Posted by ggayathri
I did this - exec script....in .profile, then placed a mail command and then an exit.
Nothing after the exec happens because the exec command tells the shell to replace itself with the new command.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need Help Urgently - ksh Script

Requirement is to list the files older than 365 days from multiple directories and delete them and log the list of files which are deleted to a log file. so 1 script should only list files older than 365 days for each directory separately to a folder The other script should read these files... (4 Replies)
Discussion started by: prasadn
4 Replies

2. UNIX for Dummies Questions & Answers

Need answers urgently!!

hello guys!! need 1 favour from u all.. Can u jst tell me the answers for these ques?? 1. ls - l _____ : command to return all files that end with single digit and those with TXT extension 2. ls -l report* _______ : command to return all files that start with the word RPT except those with LOG... (1 Reply)
Discussion started by: Gan_7
1 Replies

3. UNIX for Advanced & Expert Users

Please correct my script - Needed very urgently

hello all, I have a script, used to search for the strings from the set of 5 similar pattern file from the log dir. So here it goes . The input parameter is a part of the file name. When during the script execution, the script should parse the input parameter to original file's with the same... (1 Reply)
Discussion started by: raghunsi
1 Replies

4. Shell Programming and Scripting

Help need urgently....

I am new to shell scripting I am getting file sample.txt from mainframes to my unix machine Mon-Fri every 15 minutes from 9:00AM to 6:00PM. I need to Compare timestamp of sample.txt against system time via a Unix script kicked off by an Autosys job My Task is to write a shell script to monitor... (3 Replies)
Discussion started by: chinniforu2003
3 Replies

5. Solaris

most urgently about pc-routing

Hi I have knowledge is a little about Solaris 10. I have problem route Question I have two lan interfaces nge0 >> 192.168.1.1 / 24 and link up Client1 >> 192.168.1.10 not out internet (GW 192.168.1.254) nge1 >> 192.168.50.220 /24 and link up Client50 >> 192.168.50.1 can... (2 Replies)
Discussion started by: sermsuk
2 Replies

6. Shell Programming and Scripting

help needed urgently

hi all i need help I am confused and stucked. Actually i am new in this scripting stuff. I want to give complete txt file as a input to a variable and then sort the data in the file according to the alpha numeric characters, as my text file contains ! and !! and !!! indicating Minor, Major and... (11 Replies)
Discussion started by: nabmufti
11 Replies

7. Shell Programming and Scripting

Need help urgently

Hi to All, I m a regular visitor of this site but this one is my first thread . Although I ve tried but I cant find the solution .:confused: I ve number of files having extension .file., which having some define statement in it.The files consits as follows Ex:- abc.file `define ADCONV0 ... (3 Replies)
Discussion started by: user_prady
3 Replies

8. Shell Programming and Scripting

hi help in writing awk script(urgently)

hi to all i have file like this file.txt this is naryana expect hyderabad is a cool place now climate VISAKHSAPATNAM became very cool #vizag is my birth place #hyderabad is a cool place #now climate of hyd became very cool #vizag is my birth place #hyderabad is a cool place ... (7 Replies)
Discussion started by: LAKSHMI NARAYAN
7 Replies

9. UNIX for Dummies Questions & Answers

Need Information Urgently.

Hi i dont know about the UNIX OS at all but now as my Project requires, i need to learn it as soon as possible. Could anybody please help me out in suggessting any good elementary book on UNIX OS so that atleast i can learn the commands for UNIX servers and at the same time within the short span... (3 Replies)
Discussion started by: sumit_krishan
3 Replies

10. Shell Programming and Scripting

Shell Script needed urgently

Hi Frends, I am need of a small shell script. Kindly any body help me by giving me a small shell script to read first line in a file and extract date from the first line and store it in a variable... and after storing it in a variable the first and the last line of the file has to be deleted..... (2 Replies)
Discussion started by: vas_dba
2 Replies
Login or Register to Ask a Question