need a script to redirect the command prompt data int a log file.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting need a script to redirect the command prompt data int a log file.
# 1  
Old 10-16-2010
Wrench need a script to redirect the command prompt data int a log file.

Hello forum memebers,



I have to write a script to copy command arguments into a log.please see the below issue and help me to complete it.
i have command "mkidcfg" it is custiomized.I will run the command with one arguments .
mkidcfg -I _config.db_ids it will open the below options.
Code:
1 - Search for an ID
2 - Add an ID
3 - Update an ID
0 - Exit
Option: 2
Tag: a_app_cc
ID: mas
Password: mas123
1 - Search for an ID
2 - Add an ID
3 - Update an ID
0 - Exit
Option: 0

So now i want redirect the entire the data into one log file.when i open the log file . cat log
the below should be display.
Code:
1 - Search for an ID
2 - Add an ID
3 - Update an ID
0 - Exit
Option: Tag: a_app_cc - mas - mas123 .
1 - Search for an ID
2 - Add an ID
3 - Update an ID
0 - Exit

please help to me to write a script to done the above issue.I am looking forward from you....Smilie

Thanks & Regards
rajkumar_g

Last edited by Scott; 10-16-2010 at 07:30 AM.. Reason: Code tags again...
# 2  
Old 10-16-2010
Code:
# script -f logfile

Code:
# mkidcfg -I _config.db_ids

when you finish your job (when mkidcfg is closed)
Code:
# exit
# cat logfile

# 3  
Old 10-16-2010
Bug Thanks for view.

Can u please suggest me how to solve this is issue.

first command have to work then it have print in the log file.what are the operations done on th screen should be copy in log file.

please suggest any solution.Smilie
Its urgent.


Thanks in Advance
rajkumar g

Last edited by rajkumar_g; 10-18-2010 at 03:54 AM.. Reason: to change the status of the post
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Shell script not working but command works in command prompt

Hi everyone I have a problem with my script If I try directly this command /usr/bin/nice -n 19 mysqldump -u root --password="******" wiki_schneider -c | nice -n 19 gzip -9 > /point_de_montage/$(date '+%Y%m%d')-wiki-db.sql.gz It works But if I simply add this command in a script and... (8 Replies)
Discussion started by: picemma
8 Replies

2. Shell Programming and Scripting

Script to prompt user to enter data

Hi All I have a script that moves files from one dir to another dir based on date, but I would like to change it in a way that whoever is going to run to enter the dates in which files will be removed. This is my script: #!/bin/sh touch -mt 201302250000 /tmp/ref3 touch -mt 201302282359... (14 Replies)
Discussion started by: fretagi
14 Replies

3. Shell Programming and Scripting

script to mail monitoring output if required or redirect output to log file

Below script perfectly works, giving below mail output. BUT, I want to make the script mail only if there are any D-Defined/T-Transition/B-Broken State WPARs and also to copy the output generated during monitoring to a temporary log file, which gets cleaned up every week. Need suggestions. ... (4 Replies)
Discussion started by: aix_admin_007
4 Replies

4. Shell Programming and Scripting

Redirect output to a different text file depending source of data

I have a list of DNS servers I need to look up information on. Each of these servers has a master and a slave database. Essentially what I need to do is create two text files for each server. One with the Master view and one with the Slave view. There's 20 servers, in the end I should have 40 text... (4 Replies)
Discussion started by: spartan22
4 Replies

5. Programming

Handle int listen(int sockfd, int backlog) in TCP

Hi, from the manual listen(2): listen for connections on socket - Linux man page It has a parameter called backlog and it limits the maximum length of queue of pending list. If I set backlog to 128, is it means no more than 128 packets can be handled by server? If I have three... (3 Replies)
Discussion started by: sehang
3 Replies

6. Windows & DOS: Issues & Discussions

Redirect command prompt in C WinAPI

Anyone has a clue how to redirect the commands sent to cmd via a C WinAPI program? What I'm doing is a C WinAPI GUI program the FORM have a richtextbox that'll be read-only and some test options are offered like "all, ping, netstat, ipconfig, traceroute...) and when these tests are running I... (2 Replies)
Discussion started by: Jess83
2 Replies

7. UNIX for Advanced & Expert Users

Retrieve data and redirect to a file

How to write a shell script to retrieve datas from database after that this database are redirect to a excell sheet and then i got a mail that gives details about the database with the column name and data.. I m using oracle 9i... Thanks, Anup Das (2 Replies)
Discussion started by: anupdas
2 Replies

8. UNIX for Dummies Questions & Answers

running command prompt executable file in shell script

hi i have file extentioned with test.vbs. i am able to run this file n execute through command promt but i dont know how to run in shell script example: file name is test.vbs which contains strSoundFile = "C:\windows\Media\Notify.wav" Set objShell = CreateObject("Wscript.Shell") strCommand... (5 Replies)
Discussion started by: atl@mav
5 Replies

9. Shell Programming and Scripting

how to redirect the output of a grep command to a file inside a shell script

hi, i wat to get the output of a grep command in a file. but when i am trying out the same grep command in the unix prompt its working fine.. i am getting the output properly.. but when i am writing the same command inside my shell script , its just creating a new output file with no contents... (11 Replies)
Discussion started by: kripssmart
11 Replies
Login or Register to Ask a Question