Tag Info

New answers tagged

1

A C program (it is not called a script or a code) has to be compiled, and although you can do so from a bash script, that assumes you have a compiler installed and other necessities. Linux/Unix comes with many commands/programs, like sed, awk and cut that you mention, that (in combination) can handle the larger part of processing text. If your task ...


1

In theory, in your C program, you should add a line like this: int res = system("/bin/parted <options>"); The C program must be executed with root privileges (or run through sudo). The res variable contains the result of the command (see man system for details). As an alternative, use a command of the exec family (see man exec for details). For ...


3

You should probably be using the Pheaders, not the Sheaders. There's usually far fewer of them, and they correspond directly to pieces of the file that get mapped into memory by the kernel's ELF loader. I'm forced to use the contents of /usr/include/elf.h in the following, as you example doesn't include Elf64_Phdr definitions. Elf64_Off p_offset; /* ...


0

Yes, it is possible, but you pass a wrong switch to journalctl. According to journalctl(1) man page: To read messages with a given syslog identifier (say, "foo"), issue journalctl -t foo or journalctl SYSLOG_IDENTIFIER=foo; To read messages with a given syslog facility, issue journalctl SYSLOG_FACILITY=1 (note that facilities are stored and matched using ...


1

According to this discussion CAP_SYS_RAWIO capability needs to be applied to smartctl executable.



Top 50 recent answers are included