If the output is scrolling by too fast, you can pipe it into a pager such as less, or send it to a file with strace -o trace.log …. That won't give you output that's already been produced. ( -s9999 avoids having strings truncated to 32 characters, and write the system call that produces output.) If you want to view only data written on a particular file descriptor, you can use something like strace -p1234 -e trace= -e write=3 to see only data written to file descriptor 3 ( -e trace= prevents the system calls from being loged). If all you want to do is spy on the existing process, you can use strace -p1234 -s9999 -e write where 1234 is the process ID. ![]() Rather though, I see this as a fun learning exercise. I would like to find a way to see the script output live as if I was working locally.Ĭan anyone improve on this? The obvious answer is to restart the script with redirection or in a screen session etc, this isn't a mission critical script so I could do that. I can stop strace and then sift through the output and find the text bring printed to stdout but its very long and confusing, and obviously whilst it's stopped I might miss something. ![]() So far the best I have found is to use strace -p 18386 but I get hordes of text flying up the screen, its far too detailed. Is there anyway from an SSH session I can view the output of this running command (without stopping it)? ![]() ipchecker.sh form a local terminal window, no redirection, no use of screen etc). It is simply outputting to stdout on a local session (I ran. I can connect over SSH to the machine as the same user and see the script running in ps. I have left a script running on a remote machine from when I was locally working at it.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |