Skip to content

Tag: linux

How to find encapsulating function name from line number

I am looking at a log file which just tells me the filename and the line number inside that file that has the Error. What I am interested is knowing the encapsulating function. For example, here are the contents of the log file and here are the contents of the file foo.file Based on the above log file, I want

Where is ssize_t defined in Linux?

OS: Debian 9 (Linux 4.9) Compiler: GCC 8.2 Currently I am including <stddef.h> (where size_t is defined) and <stdint.h> (where most integral types are defined), but I still don’t have ssize_t. Where is it defined? Answer ssize_t is defined in sys/types.h. Per the POSIX documentation: NAME sy…

shell script to change directory to the tail result path

I’m using Tail to an error happen on the log lines like: and this gives results like: So what I do manually is to change the path using cd: Is there any script to change directory automatically? As I run another manual script to change file names for the files contained in /003217899/, those like /00321…

Looking to remove a set of characters from a .txt file

I am looking for a way to remove the content from one .txt file based on the other. For example, I have a file.txt with 2000 character that are random and not sorted. I have another file importantfile.txt with 2016 characters that have the same characters that file.txt has as well as 16 other characters rando…