>I am trying to figure out what is the difference between executing a
>shellscript foo as
>
>sh foo
>
>compared to sh < foo.
Not much:
-
the former maintains the stdin of its invoking environment,
the latter forces stdin to come from the script, thus making
non-redirected "read"s inside the script to behave oddly (and
also affecting any program invoked by "foo" which read stdin);
-
$0 in the former is set to "foo"; in the latter it is "sh".
Ken Pizzini