how to put into logs the exact doing of script!


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting how to put into logs the exact doing of script!
# 1  
Old 11-02-2011
how to put into logs the exact doing of script!

Hi All,

I'm a newbie here, I'm just wondering how can i put into the logs of the exact doing of script.

ex.:
test1.sh
Code:
abcd@10.226.144.180's password:
20111102 17:20:02 || FILE FOUND IN ICCBS SERVER
20111102 17:20:02 || ACCESS ICCBS SERVER TO GET FILES
Connecting to 10.226.144.180...
abcd@10.226.144.180's password:
sftp> cd /home/conubtch/HUAWEI/
sftp> get 1.txt
Fetching /home/conubtch/HUAWEI/1.txt to 1.txt

how can i put it in logs the red color?

Please advise,
Thanks,

Moderator's Comments:
Mod Comment As already written use code tags instead of coloring everything, please. Check your PMs for instructions. If you do not understand this, just ask. If you tend to ignore this you collect more infraction points until being automatically banned. Consider if this is necessarry, thanks.

Last edited by zaxxon; 11-02-2011 at 06:38 AM..
# 2  
Old 11-12-2011
Directing standard-output doesn't work here, I think. This leaves you with:

1. Using screen and its screen-log feature.

2. Using expect.

Which is best for you depends on your setup and exact purpose.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to see the status of all the ftp put & get files logs and curent ftp transfer status ?

How to see the status of all the ftp put & get files logs and curent ftp transfer status if any active ftp running in the background ? (2 Replies)
Discussion started by: i4ismail
2 Replies

2. Shell Programming and Scripting

If I ran perl script again,old logs should move with today date and new logs should generate.

Appreciate help for the below issue. Im using below code.....I dont want to attach the logs when I ran the perl twice...I just want to take backup with today date and generate new logs...What I need to do for the below scirpt.............. 1)if logs exist it should move the logs with extention... (1 Reply)
Discussion started by: Sanjeev G
1 Replies

3. Shell Programming and Scripting

Grep the exact process in perl script

I am working on one script where I need to grep the exact process in perl script. for e.g. when I run simple grep command on the linux machine it gives me two process mGateway_mvc_q01 and mGateway_mvc_q01_v7 which is not the correct result.I tried to use ( ps -eAf | grep ^mGateway_mvc_q01$) but... (1 Reply)
Discussion started by: anuragpgtgerman
1 Replies

4. Shell Programming and Scripting

Help me with s script to find exact match

Hi, im extracting data from oracle DB. As the data is case sensitive, i have to extract the data which doesn't match exactly. im poor in unix scripting, can someone plz help me with a script. Here are the details. Need to compare the second column of the each line of the file1.csv with the data in... (5 Replies)
Discussion started by: JSKOBS
5 Replies

5. Shell Programming and Scripting

echo exact xml tag from an exact file

Im stumped on this one. Id like to echo into a .txt file all names for an xml feed in a huge folder. Can that be done?? Id need to echo <name>This name</name> in client.xml files. $path="/mnt/windows/path" echo 'recording names' cd "$path" for names in $path than Im stuck on... (2 Replies)
Discussion started by: graphicsman
2 Replies

6. Shell Programming and Scripting

QUESTION1: grep only exact string. QUESTION2: find and replace only exact value with sed

QUESTION1: How do you grep only an exact string. I am using Solaris10 and do not have any GNU products installed. Contents of car.txt CAR1_KEY0 CAR1_KEY1 CAR2_KEY0 CAR2_KEY1 CAR1_KEY10 CURRENT COMMAND LINE: WHERE VARIABLE CAR_NUMBER=1 AND KEY_NUMBER=1 grep... (1 Reply)
Discussion started by: thibodc
1 Replies

7. Shell Programming and Scripting

How to know the exact running time of script!

Hi All, newbie here, I'm just wondering how can i know the exact running time of my script? Please advise, THanks, (1 Reply)
Discussion started by: nikki1200
1 Replies

8. Shell Programming and Scripting

Can we do exact awk in shell script

Hi, I have three strings: BusinessService=one BusinessService1=two BusinessService_test=three If I user awk command, the out put will be all these. Actually am searching for "BusinessService" only. Can we do exact awk command. And the same tiem ,I cant user grep also. Because i need... (4 Replies)
Discussion started by: ckchelladurai
4 Replies

9. Shell Programming and Scripting

to get the exact word from the file using script

Hi everybody, I have one requirment, i have to get the particular server name from a file. EX: File contents will be like below.. $cat test.txt HostAssignments->new("server1", [ "PS_SERVER", "REG_SERVER", "PS_ORACLE", "OM_G10_AUD", "OM_G10_CAD", "OM_G10_CHF", ... (3 Replies)
Discussion started by: raghu.iv85
3 Replies

10. Shell Programming and Scripting

How to put multiple logs in single line?

Hi, I have a script which generates a log file on demand by redirecting the output to a log file. But the requirement is : echo A echo B echo C should print A B C not like A B C and this has to be handled in script only..not in the shell level (while running the script only) .... (5 Replies)
Discussion started by: bhaskar_m
5 Replies
Login or Register to Ask a Question