Relative Content

Tag Archive for bash

Bash script and system call questions

int main() { char buf[2]; read((0, buf, 2); lseek(0, 1, 1); write(1, buf, 2); } The rwl program, whose source code is shown on the top, is run with the following command on a 2-line fileA text file with “01234” data on each line. Determine the data that this command will display and the changes […]

How to remove lines of file content, if has specific trailing string? [duplicate]

This question already has answers here: Negative matching using grep (match lines that do not contain foo) [duplicate] (3 answers) Regular expression to match a line that doesn’t contain a word (34 answers) Closed 4 days ago. There is a file with this simple content: projectA-app1 projectA-app2 projectA-app-mobile projectB-app1 Now I need to get every […]