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 set a bash variable with environment variables?
I have environment variables
How to set a bash parameter with environment variables?
I have environment variables
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 […]
Why does “” remain in bash quoted strings when escaping “!”?
I recently came across this surprising behavior involving "
and !
in bash:
Bash script invalid expression; I was expecting to find a ‘)’ [closed]
Closed 3 days ago.
Directory goes missing when piping basename from dirname
Given the folder structure
Directory goes missing when piping basename from dirname
Given the folder structure
How can executable modify it’s caller’s bash history?
I have a program which can be invoked with an ncurses TUI (no arguments), or with arguments.
Dynamically inject variable into the data parameter of a curl statement
Given the –data parameter of a curl statement: