1

Other than doing:

$ ./script < myfile.txt

Is there a way to pass text directly in the command-line, for example something like:

./script < "hello this is not a test"

The program I have which I want to send text to is:

// script.c
 #include<stdio.h>
 int main(void)
 {
     char c;
     while ((c = getchar()) != EOF)
         putchar(c);
 }
carl.hiass
  • 1,526
  • 1
  • 6
  • 26

0 Answers0