Linked Questions

2
votes
2answers
398 views

xargs and < and > to the same files [duplicate]

I want to run git stripspace on all my source code files, on each build (or precommit or just manually), to remove extraneous whitespace, and later maybe to format the code in a standard way, So ...
1
vote
1answer
1k views

How to redirect stdin and stdout and stderr at the same time in bash? [duplicate]

I want to redirect stdin and stdout and stderr at the same time in bash, is this how it's done: someProgram < stdinFile.txt > stdoutFile.txt 2> stderrFile.txt
2
votes
1answer
987 views

How redirecting debug output to a file [duplicate]

I use -x for debug info while executing the shell script. How can I redirect debug info only to a file? Example script: #!/bin/bash echo OK echo NO i will get the below result when i run in debug ...
0
votes
1answer
849 views

Ampersand in Cronjob [duplicate]

I have found the following entry in a user crontab: */5 * * * * ~/bin/php /path/to/phpscript &> /path/to/logfile What is the meaning of the & (ampersand) here? Has it still the meaning ...
2
votes
2answers
300 views

Insert result of command into an executable (one command) [duplicate]

Is it possible to insert the result of a command (or even a chain of commands) into an executable in one command? Something like this: ./a.out < echo 0 Or is it necessary to do this: echo 0 > ...
1
vote
1answer
210 views

Does ampersand also function as line terminator? [duplicate]

I know that in bash, the & symbol delegates a command to the background, but is it also supposed to double as a special line terminator? To give an example of what I'm referring to, I found this ...
0
votes
1answer
600 views

opening multiple tabs in firefox using a one-liner bash script [duplicate]

I am on CentOS 6.6. I have a program that runs analysis and outputs its data in html files. The file structure is dir1/dir1.html dir2/dir2.html dir3/dir3.html I want to open all three html files ...
0
votes
1answer
265 views

What does this bash operation do? [duplicate]

I recently came across this command in bash: cat > filename << EOF I do not understand the << EOF part. Googling the << operator, I only came across regular shift arithmetic ...
0
votes
1answer
415 views

Unix, create file based on command [duplicate]

I have a command, but I want to get the results into a .txt file I can open. How do I alter my command to allow the results to be put into a text file. I plan to transfer this .txt file to my local ...
0
votes
1answer
241 views

the T-split command in linux as opposed to cat? [duplicate]

so for a question I have to store both messages of x and y to log, since y only exists and x does not I used cat x y &> log to be able to store both messages. However as the second part my ...
1
vote
3answers
85 views

What is `>&` in simple terms? [duplicate]

What does $ command 1>&2 do? As I understand it this runs the command but with the STDOUT redirected to the STDERR. But I'm not sure exactly how >& works. I have seen it as $ command 1&...
0
votes
1answer
149 views

One liner to replace file contents [duplicate]

When I run base64 filename >> encodedfile the new content is appended to existing content. Is there any way I can replace entire old content with new content. Using any similar one line ...
1
vote
2answers
85 views

why <<\END is used in ed [duplicate]

Using ed put character # to the beginning of lines 10 to 20 in file /etc/passwd. Solution is the following ed /etc/passwd <<\END 10,20s/^/#/ %p Q END my question is that what does << ...
0
votes
2answers
94 views

What are the steps of this command using ; || and && [duplicate]

Note: A B C are commands..... Please tell me what the step process would be of these commands, so I can better understand the language.. A || B ; C = If A fails then run B then C? A ; B || C = Run A ...
1
vote
1answer
91 views

Difference between 2>&1 <command> and <command> 2>&1 [duplicate]

I have the following two invocations of a function in bash, which I'm piping to another function which captures the error output: >&2 log_stdout | log_err log_stdout >&2 | log_err Is ...

15 30 50 per page