mm2270 / Casper-API

Casper Suite JSS API scripts and applications
66 stars 10 forks source link

JSS-Package-Report Issues #1

Closed rquigley-woodleigh closed 8 years ago

rquigley-woodleigh commented 8 years ago

Hi,

Currently having this output issue attempting to use the JSS Package Report Tool.

JSS-Package-Report.sh: line 66: syntax error near unexpected token `<'

JSS-Package-Report.sh: line 66: `done < <(ls "/tmp/workingDir/Policies/")')

Thanks.

mm2270 commented 8 years ago

Hi rquigley-woodleigh,

We typically will only see this error if the script is directed to run in the Bourne shell (sh) instead of in the Bash shell. For example, if I run the script as follows:

sh /path/to/JSS-Package-Report.sh

I will immediately see an error of:

/path/to/JSS-Package-Report.sh: line 66: syntax error near unexpected token `<'
/path/to/JSS-Package-Report.sh: line 66: `done < <(ls "/tmp/workingDir/Policies/")'

The reason is because specifying sh as I did above will tell Terminal to run the script in the Bourne shell (#!/bin/sh) and override the shebang in the script (#!/bin/bash) The done < <(some command) syntax does not work with /bin/sh, but does in /bin/bash

If I instead just use the following:

/path/to/JSS-Package-Report.sh

then the script runs fine to completion.

Can you see if perhaps this is the reason for the error?

rquigley-woodleigh commented 8 years ago

Hi mm2270,

You were indeed correct. I was referring to sh, instead of bash.

My apologises for the report and it's working as we speak.

Thanks.