Skip to content

Instantly share code, notes, and snippets.

@Sarverott
Created April 30, 2022 13:30
Show Gist options
  • Save Sarverott/cb0d857d08dddbc8ebe159cb64c1c2c8 to your computer and use it in GitHub Desktop.
Save Sarverott/cb0d857d08dddbc8ebe159cb64c1c2c8 to your computer and use it in GitHub Desktop.
// EXECUTE: help | pipetest "dest.txt" | find "HELP"
#include <iostream>
using namespace std;
int main(int argc, char *argv[]){
char tmpBuff=0;
while(argc-->0){
cout<<"\t"<<(argv++)<<endl;
}
while(cin.good()){
if(cin.get(tmpBuff))cout.put(tmpBuff);
//if(cin.get(tmpBuff))cerr.put(tmpBuff);
//if(cin.get(tmpBuff))clog.put(tmpBuff);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment