I know that well-behaved utilities like grep output "normal" messages to stdout, and error messages to stderr. $ grep '^foo' file1 file2 file1:foo grep: file2: No such file or directory When I'm ...
How do you store, and later execute, a command with redirection and and a pipe? (And is it the pipe, or the redirection, or both, that's causing my problem?) I tried to print the urxvt version in a ...
How to add a line to a file which has only root write permission and to continue the script execution
I am trying to learn bash scripting. I am working on a practical problem and at one point I need to add a line to a file which requires root permission to write. The code looks like this: # some ...
What does the following script mean? exec 4<&0 0</etc/XX/cfg read line1 exec 0<&4 UPDATE Thanks for the answer, just one part I'm not sure: It redirects fd0 to fd4, and ...
Hi good people of this community, Say I have a script called script, that reads from stdin and spits out some results to the screen. If I wanted to feed it contents of one file, I would have typed: ...
I want to loop over the output of a command without creating a sub-shell or using a temporary file. The initial version of of my script looked like this, but this doesn't work since it creates a ...