Server IP : 85.214.239.14 / Your IP : 3.129.194.30 Web Server : Apache/2.4.62 (Debian) System : Linux h2886529.stratoserver.net 4.9.0 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.18 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /proc/2/cwd/usr/share/doc/lsof/examples/ |
Upload File : |
Notes on Using the Scripts in This Subdirectory The scripts in this subdirectory are examples of post-processing lsof field output. Some are contributed by lsof users and are reproduced substantially as written by those users. Since the scripts are examples, they are not guaranteed to work on all UNIX dialects. Use them to learn about processing field output, don't expect them to be ready for production, and expect to be required to modify them to make them work. If you want to do field output post-processing in a C program, take a look at the test suite C library in ../tests/LTlib.c. You may be able to adapt it to your needs. Supply AWK scripts to your AWK interpreter with its -f option. Supply lsof field output via a pipe -- e.g., lsof -F | awk -f list_fields.awk The Perl scripts use the Unix command interpreter line feature to specify the location of Perl -- i.e., the first line begins with ``#!'' and the path to the Perl interpreter follows. If your system supports the command interpreter feature, but your Perl interpreters have different paths to them, just change the interpreter lines in the scripts. These scripts assume Perl lives at /usr/bin/perl. If your system doesn't support the command interpreter feature, you'll have to supply the scripts to your Perl interpreter on its command line -- e.g., lsof -F | /<path_to_your_perl> list_fields.pl The Perl scripts attempt to establish a path to lsof, putting their result in the $LSOF variable. Assuming you'll run them from the scripts subdirectory, they look there first, then in the directories of the PATH environment variable. If that proves unsuitable, modify the &isexec() subroutine calls in the scripts to suit your lsof location. Vic Abell April 4, 2002