Get the file name from tusc output.


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Get the file name from tusc output.
# 1  
Old 09-12-2013
Get the file name from tusc output.

I needed to get the list of files accessed by a process nad its children. I tried using tusc and I got a complete list of read system calls. But how to get the file mane form that output.

This is the command I used:
Code:
tusc -kfs read <pid>

and this is the sample of the output I got:
Code:
read(3, "02\v010e0512@ \0L 0fO fd\0\0\0\0".., 128) ............................................................................................... = 128
read(3, "10\0\004\0\0\0( \003H \ \0\0\0\0".., 48) ................................................................................................ = 48
read(3, "0214010e0512@ \0\0\0\0\0\0\0\0\0".., 128) ............................................................................................... = 128
read(3, "10\0\004\0\0\0( \016e304\0\010\0".., 48) ................................................................................................ = 48
read(3, "80\0\0\v\0\0\004\0\0\0\0", 12) .......................................................................................................... = 12
read(3, "02\v010e0512@ \0L 0fO fe\0\0\0\0".., 128) ............................................................................................... = 128
read(3, "10\0\004\0\0\0( \0\0) \ \0\010\0".., 48) ................................................................................................ = 48
read(3, "80\0\0\v\0\0\004\0\0\0\0", 12) .......................................................................................................... = 12
read(4, "\0\0018d", 4) ........................................................................................................................... = 4
read(4, "c o n f i g \0\0\0\0\0\0\0\0\0\0".., 17468) ............................................................................................. = 17468
read(4, "# \n#   / e t c / n s s w i t c ".., 8192) .............................................................................................. = 370
read(4, 0x4002c1a8, 8192) ........................................................................................................................ = 0
read(4, "0210010e0512@ \0\0\0\0\0\0\0\0\0".., 128) ............................................................................................... = 128
read(4, "10\0\004\0\0\0( \0\08d04\0\010\0".., 48) ................................................................................................ = 48
read(4, "80\0\0\v\0\0\004\0\0\0\0", 12) .......................................................................................................... = 12
read(4, "r o o t : T V x 9 c 4 l P H M C ".., 8192) .............................................................................................. = 1116
read(4, "# # # # # # # # # # # # # # # # ".., 8192) .............................................................................................. = 319
read(3, "m s g c a t 0 1 \0\0\0D \001\001".., 1212) .............................................................................................. = 1212
read(3, "U I D ", 3) ............................................................................................................................. = 3
read(3, "m s g c a t 0 1 \0\0\0D \001\001".., 1212) .............................................................................................. = 1212
read(3, "P I D ", 3) ............................................................................................................................. = 3
read(3, "m s g c a t 0 1 \0\0\0D \001\001".., 1212) .............................................................................................. = 1212
read(3, "P P I D ", 4) ........................................................................................................................... = 4
read(3, "m s g c a t 0 1 \0\0\0D \001\001".., 1212) .............................................................................................. = 1212
read(3, "C ", 1) ................................................................................................................................. = 1
read(3, "m s g c a t 0 1 \0\0\0D \001\001".., 1212) .............................................................................................. = 1212
read(3, "S T I M E ", 5) ......................................................................................................................... = 5
read(3, "m s g c a t 0 1 \0\0\0D \001\001".., 1212) .............................................................................................. = 1212
read(3, "T T Y ", 3) ............................................................................................................................. = 3
read(3, "m s g c a t 0 1 \0\0\0D \001\001".., 1212) .............................................................................................. = 1212
read(3, "T I M E ", 4) ........................................................................................................................... = 4
read(3, "m s g c a t 0 1 \0\0\0D \001\001".., 1212) .............................................................................................. = 1212
read(3, "C O M M A N D ", 7) ..................................................................................................................... = 7
read(4, "r o o t : T V x 9 c 4 l P H M C ".., 8192) .............................................................................................. = 1116
read(5, 0x7f617b00, 4) ........................................................................................................................... = 0
read(3, "          U I D       P I D     ".., 8192) .............................................................................................. = 164
read(3, 0x40278070, 8192) ........................................................................................................................ = 0
read(3, "02\v010e0512@ \0L 0fO fd\0\0\0\0".., 128) ............................................................................................... = 128
read(3, "10\0\004\0\0\0( \003H \ \0\0\0\0".., 48) ................................................................................................ = 48
read(3, "0214010e0512@ \0\0\0\0\0\0\0\0\0".., 128) ............................................................................................... = 128
read(3, "10\0\004\0\0\0( \016e304\0\010\0".., 48) ................................................................................................ = 48

This is just first few line. There many like this.

How do I get the filename from this?

I am using HP-UX .

Please do help.
# 2  
Old 09-12-2013
Use tusc to show the open system calls, that gives the filename for each one opened.
This User Gave Thanks to jim mcnamara For This Post:
# 3  
Old 09-12-2013
Now got the file names...thanks a lot!!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script (sh file) logic to compare contents of one file with another file and output to file

Shell script logic Hi I have 2 input files like with file 1 content as (file1) "BRGTEST-242" a.txt "BRGTEST-240" a.txt "BRGTEST-219" e.txt File 2 contents as fle(2) "BRGTEST-244" a.txt "BRGTEST-244" b.txt "BRGTEST-231" c.txt "BRGTEST-231" d.txt "BRGTEST-221" e.txt I want to get... (22 Replies)
Discussion started by: pottic
22 Replies

2. Shell Programming and Scripting

Getting output from a file similar to cat output

I have a file # cat /root/llll 11 22 33 44 When I cat this file content to a variable inside a shell script and echo that shell script, it does not show up as separate lines. I need echo output similar to cat. cat /root/shell_script.sh #!/bin/bash var=`cat /root/llll` echo $var (2 Replies)
Discussion started by: anil510
2 Replies

3. Shell Programming and Scripting

Redirect script output to a file and mail the output

Hi Guys, I want to redirect the output of 3 scripts to a file and then mail the output of those three scripts. I used below but it is not working: OFILE=/home/home1/report1 echo "report1 details" > $OFILE =/home/home1/1.sh > $OFILE echo... (7 Replies)
Discussion started by: Vivekit82
7 Replies

4. Shell Programming and Scripting

How to grep the desired output and output to a file?

currently I have process from a raw file to this stage ALTER TABLE "EXCEL_ADMIN"."TC_TXN_VOID" ADD CONSTRAINT "PK_TC_TXN_VOID" PRIMARY KEY ("TC_TXN_IID") ALTER TABLE "EXCEL_ADMIN"."TC_TXN_AMT" ADD CONSTRAINT "PK_TC_TXN_AMT" PRIMARY KEY ("TC_TXN_AMT_IID") ALTER TABLE... (10 Replies)
Discussion started by: jediwannabe
10 Replies

5. Red Hat

Command understanding the output file destination in case of standard output!!!!!

I ran the following command. cat abc.c > abc.c I got message the following message from command cat: cat: abc.c : input file is same as the output file How the command came to know of the destination file name as the command is sending output to standard file. (3 Replies)
Discussion started by: ravisingh
3 Replies

6. Shell Programming and Scripting

Displaying log file pattern output in tabular form output

Hi All, I have result log file which looks like this (below): from the content need to consolidate the result and put it in tabular form 1). Intercomponents Checking Passed: All Server are passed. ====================================================================== 2). OS version Checking... (9 Replies)
Discussion started by: Optimus81
9 Replies

7. 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

8. Shell Programming and Scripting

Match list of strings in File A and compare with File B, C and write to a output file in CSV format

Hi Friends, I'm a great fan of this forum... it has helped me tone my skills in shell scripting. I have a challenge here, which I'm sure you guys would help me in achieving... File A has a list of job ids and I need to compare this with the File B (*.log) and File C (extend *.log) and copy... (6 Replies)
Discussion started by: asnandhakumar
6 Replies

9. Shell Programming and Scripting

Awk script to run a sql and print the output to an output file

Hi All, I have around 900 Select Sql's which I would like to run in an awk script and print the output of those sql's in an txt file. Can you anyone pls let me know how do I do it and execute the awk script? Thanks. (4 Replies)
Discussion started by: adept
4 Replies

10. Shell Programming and Scripting

Dynamic output file generation using a input text file with predefined output format

Hi, I have two files , one file with data file with attributes that need to be sent to another file to generate a predefined format. Example: File.txt AP|{SSHA}VEEg42CNCghUnGhCVg== APVG3|{SSHA}XK|"password" AP3|{SSHA}XK|"This is test" .... etc --------- test.sh has... (1 Reply)
Discussion started by: hudson03051nh
1 Replies
Login or Register to Ask a Question