cat file1 | grep main > result
Valid
okay
okay
cat < file1 | grep main > result
Valid
okay
okay
cat < file1 | grep main > result
Valid
okay
okay
< file1
Invalid: Missing command name
okay
cat file1 <
Invalid: Standard input redirection without file name
okay
cat file1 < | grep str
Invalid: Standard input redirection without file name
okay
cat file1 >
Invalid: Standard output redirection without file name
okay
cat file1 > | grep str
Invalid: Standard output redirection without file name
okay
cat file1 > file2 > file3
Invalid: Multiple redirection of standard output
okay
cat < file1 < file2
Invalid: Multiple redirection of standard input
okay
cat file1 | cat < file2
Invalid: Multiple redirection of standard input
okay
cat file1 > out | grep str
Invalid: Multiple redirection of standard output
okay