When most modern command interpreters (AKA "shells") see foo -a -b -c > bar They take is as a directive to execute foo, passing the arguments "-a", "-b", and "-c", and arranging for foo's output to be redirected to bar. This means that foo never sees ">" or "bar". Instead, the command interpeter has connived with the operating system to open bar and arranged for foo's "standard output" to go to bar rather than the display.
Similarly, foo < bar means that foo's "standard input" is bar, rather than the console. The command interpeter (shell) has stripped off the "<" and "bar" and has connived with the O/S to redirect foo's standard input.
What I suspect this means for you is that you've inherited Someone Else's Code for producing HTML. The script likely writes implicitly to STDOUT. Adding "> sample.html" on the invoking command line tells the shell to direct the script's output to "sample.html".
The simple way to tell if this is the case is to examine the code for print statements that don't specify a file handle, such as print "<h1>Hi Mom!</h1>\n";
Update: I looked back over some of nysus's posts, and it seems pretty clear that he does understand I/O redirection. So this is off target for this thread. On target after all.
In reply to Re: Re: Passing command-line arguments to a file
by dws
in thread Passing command-line arguments to a file
by nysus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |