redirection < operator not working pls help
Redirection operator < is used to read input from a file to a command.
I tried $cal < myfile myfile contains data: 2000 but the above command is not working. I wanted to make the cal command read input from the file 'myfile' and display the calendar of year 2000. I am using the I/O redirection operator in the above command. Why the above command is not working? How to make it to work?? pls help, thanks in advance. |
cal does NOT read from stdin. The < operator sends the contents of the specified file to the standard input (stdin) of the specified program. Since cal does not read from stdin, this will not work. Check the cal manpage (man cal).
If you want to print the calendar for 2000, just do: Code:
cal 2000 Code:
cal $(<myfile) |
thank you!that is my problem too.
|
thank you!
that is my problem too. |
All times are GMT -5. The time now is 09:24 PM. |