[cs615asa] HW3 revisited

Jan Schaumann jschauma at stevens.edu
Sat Mar 21 18:17:23 EDT 2015


Jan Schaumann <jschauma at stevens.edu> wrote:

> By adding what Somebody Somewhere On The Internet claimed to be a valid
> IPv6 matching regex, you needlessly made the program overly complex,
> harder to read, and more error prone:  now you needed a grep(1) that can
> parse this regular expression.  Not all Unix versions ship a grep(1)
> that does this.  As a result, many of your submissions failed miserably
> when run on OmniOS.

There is an interesting discrepancy in behaviour on OmniOS that just
lead me to re-evaluate a few of your submissions.  As I noted, I ran
your command like this:

ssh ${host} "/sbin/ifconfig -a | ./ifcfg-data -${flag}"

This means that I am providing the command to run immediately to the ssh
command rather than logging in interactively and then running the
command.  On the OmniOS instance, this leads to a different PATH being
set: interactive shells get PATH=/usr/gnu/bin:/usr/bin:/usr/sbin:/sbin,
while non-interactive shells get PATH=/usr/sbin:/usr/bin.

That means that in an interactive shell, you will have the GNU tools
available first, and your script, when invoking 'grep' or 'awk' will run
/usr/gnu/bin/grep or /usr/gnu/bin/awk.  These versions of these tools
differ from those provided by OmniOS in /usr/bin, and then lead to
errors when your script relies on flags that are only supported in one
version or the other.

The correct way to address this would be the to explicitly set the PATH
in your script to ensure the right tools get invoked.  However, I do not
expect you to know this, so I'm updating the grades of those of you who
had failures on OmniOS that resulted from this behaviour.

-Jan


More information about the cs615asa mailing list