How to print log of gawk


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to print log of gawk
# 1  
Old 03-14-2012
How to print log of gawk

I have used gawk inside my script. But
Quote:
set -vx
doesn't make log of that. So, what is the way to make logs of gawk block

Thanks for replying...Smilie
# 2  
Old 03-15-2012
Show your code and maybe we'll see why that isn't logging.
# 3  
Old 03-15-2012
To my knowledge there is no equivalent of a set -x for an awk programme. I usually add printf() statements at key points and print the information I am interested in seeing.

EDIT: @Corona688, I got the impression that it was the execution of the awk that ezee wished to have traced as opposed to the shell tracing the actual awk command.
These 2 Users Gave Thanks to agama For This Post:
# 4  
Old 03-15-2012
Thanks agama
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Print the one function's log to the screen

c() { if something failed;then echo "failed" exit 1 fi } f() { functinona #if something failed call "c" functionb #if something failed call "c" } f > log 2>&1 #put the log to file not print on the screen I want all the stdout/stdrr to the log file... (3 Replies)
Discussion started by: yanglei_fage
3 Replies

2. SCO

Need help with gawk

I am trying to use gawk to search a file and put the second value of the string into a string. gawk -F: '$1~/CXFR/ {print $2}' go.dat Below is the file 'go.dat' ==================== HOME :/ CTMP :/tmp CUTL :/u/rdiiulio/bin CWRK :/u/work CXFR :/u/xfer ... (1 Reply)
Discussion started by: trolley
1 Replies

3. Shell Programming and Scripting

Gawk Find Pattern Print Lines Before and After

Using grep I can easily use: cvs log |grep -iB 10 -A 10 'date: 2013-10-30' to display search results and 10 lines before and after. How can this be accompished using gawk? (4 Replies)
Discussion started by: metallica1973
4 Replies

4. Shell Programming and Scripting

[Solved] Do not want to print sftp commands in log

Hi, While running my ksh file, I require the logs to be written to another file. For this I use the below code: write_log() { echo `date +"%d %h, %Y %H:%M:%S"` " : " $* >> ${LOG_FILE} } But inside my ksh file, am connecting to sftp server and executing some commands. So while i see... (8 Replies)
Discussion started by: confused_info
8 Replies

5. Shell Programming and Scripting

Print first 20 lines from all .log files

RHEL 5.8 In a directory I have more than 200 files with the extension .log Using head command I want to print first 20 lines of each log file. For each .log file, it should print like below Printing first 20 lines of : GRP_error_April29.log Apr 29 04:02:05 raptor03b syslogd 1.4.1:... (4 Replies)
Discussion started by: John K
4 Replies

6. Shell Programming and Scripting

How to print complete log

Hi, I tried set -vx globally but this doen't print traces inside functions Thanks in advance (1 Reply)
Discussion started by: ezee
1 Replies

7. Shell Programming and Scripting

gawk print some special lines

Hi every body, i have this file example : TD1 TD2 TD3 . . .TDn <DIE_1> xxxxxx <\DIE_1> <TD1> information 1 inormation n <\TD1> <TDq> information (0 Replies)
Discussion started by: kamel.kimo
0 Replies

8. Shell Programming and Scripting

Print log to an email

Hi, I have wrote a script and i want to be able to output my variable MSG_DEST (which is a log) to an email. so basically log contains: hello John when i email recipient it says to xxxxxx from xxxxxx subject xxxxxx hello John What do I need to put in my... (3 Replies)
Discussion started by: Pablo_beezo
3 Replies

9. Shell Programming and Scripting

perl - print to a log file and screen

as the title suggests, i need to print a user message to a log file and the screen using perl. in unix i set up a function using 'tee' like so function Display_Message { echo "$*" | tee -ai $LOGFILE } the following command then obviously displays to the screen and prints to a log... (6 Replies)
Discussion started by: mjays
6 Replies

10. Shell Programming and Scripting

gawk HELP

I have to compare records in two files. It can be done using gawk/awk but i am unable to do it. Please help me File1 ABAAAAAB BC asa sa ABAAABAA BC bsa sm ABBBBAAA BC bxz sa ABAAABAB BC csa sa ABAAAAAA BC dsa sm ABBBBAAB BC dxz sa File 2 ABAAAAAB BC aas ba ABAAAAAB BC asa sa... (6 Replies)
Discussion started by: sandeep_hi
6 Replies
Login or Register to Ask a Question