directing input to stdin not working

Hi I am working on some code and I just want to build an automated test for it. The problem is that when I run the .sh file I made, I get an error in the input redirection part. How can I fix this? I know I can use files, but I also know this method is possible and I'm probably just using the wrong syntax.

Here is the file contents
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh
g++ -Wall -Wextra -o auto -g OneLine.cc
#Compile the code

for n in {1..10}
   do
      r=$RANDOM
      t=$RANDOM
      s=$RANDOM
      f=$RANDOM
      time ./auto <<< "$r $t $s $f" > /dev/null 2>&1
      #time each test by directing input with <<< command 
      #and redirect error to bit bucket
   done
echo "Done"
Last edited on
I was running it with the wrong shell. I should have been using bourne again shell not sh
Topic archived. No new replies allowed.