I make a simple c file which takes input from user and then display it. I am trying to make a bash script in which i predefined those input and then run the c program inside bash and the c program takes the input which i have defined (i.e. user don't need to enter the input)
Here is the code.
printf("Enter a single character:\n");
printf("Enter any number:\n");
printf("You type charachter %c\n", ch);
printf("You type number %d\n", num);
And here is the bash file
./test < $ch $num
When i run the bash script it don't take the input values of ch and num. then i find on Google to use | so i tried ./test | $ch $num but didn't work
Please help me.