I'm looking for a little shell script that will take anything piped into it, and dump it to a file.. for email debugging purposes. Any ideas?
相关问题
- Is shmid returned by shmget() unique across proces
- how to get running process information in java?
- Error building gcc 4.8.3 from source: libstdc++.so
- Why should we check WIFEXITED after wait in order
- Null-terminated string, opening file for reading
Use
<<command>> | tee <<file>>
for piping a command<<command>>
into a file<<file>>
.This will also show the output.
if you don't care about outputting the result
or
If you want to analyze it in the script:
But you can simply use cat. If cat gets something on the stdin, it will echo it to the stdout, so you'll have to pipe it to cat >$OUTPUT. These will do the same. The second works for binary data also.
If you want a shell script, try this:
Huh? I guess, I don't get the question?
Can't you just end your pipe into a
>> ~file
For example
will append Foobar to the dumpfile (and create dumpfile if necessary). No need for a shell script... Is that what you were looking for?