microsoft/shell-intune-samples

Unexpected token

mgdmdz opened this issue · 20 comments

Install Acrobat.sh: line 770: syntax error near unexpected token `>'
Install Acrobat.sh: line 770: `    exec &> >(tee -a "$log")'

please tell me what I'm doing wrong because I'm sure I am :)
Running on Catalina.

I am having the same issue :(
Running Monterey

Can you send me the complete log please? I've just tested and it seems fine for me. Are you downloading and running on macOS or editing in Windows first?

Running via Intune seems to be working. Ye I edited it on Windows and copied over the script using one drive.
syntax error near unexpected token >' exec &> >(tee -a "$log")'

This is all I receive as an error, no logs generated.

Edit: Just tried to copy paste your code to my macbook directly and getting the same errors.

Can you send me the complete log please? I've just tested and it seems fine for me. Are you downloading and running on macOS or editing in Windows first?

no logs, just this error. Failed via Intune as well. . Just says "script failed to run". Ran on macOS directly as well.

Can one of you send me a link to the precise code that you are running please? I can't find any reference of 'Install Acrobat.sh' anywhere in the repo.

Can one of you send me a link to the precise code that you are running please? I can't find any reference of 'Install Acrobat.sh' anywhere in the repo.

i have just renamed the script for my liking. Could this be a problem? That's the only change.

Can one of you send me a link to the precise code that you are running please? I can't find any reference of 'Install Acrobat.sh' anywhere in the repo.

nope, still the same error even when keeping the old name,

There is a sample specifically for Acrobat Reader here : https://github.com/microsoft/shell-intune-samples/tree/master/Apps/AdobeAcrobatReaderDC

i downloaded the RAW before. Should I do something differently?

Right click where it says 'RAW', select save-as and save locally, then run chmod +x, then run the script with sudo on the Mac. Try to avoid editing Mac shell scripts on Windows if you can.

I've also removed some of the older samples, you should be using 3.0.6 from here https://github.com/microsoft/shell-intune-samples/blob/master/Apps/LatestSampleScript/installIntuneApp3.06.sh

I've also removed some of the older samples, you should be using 3.0.6 from here https://github.com/microsoft/shell-intune-samples/blob/master/Apps/LatestSampleScript/installIntuneApp3.06.sh

still the same error unfortunately.
Install Acrobat.sh: line 770: syntax error near unexpected token >' Install Acrobat.sh: line 770: exec &> >(tee -a "$log")'

I've literally just updated this and checked on three machines, so the code is fine : https://github.com/microsoft/shell-intune-samples/tree/master/Apps/AdobeAcrobatReaderDC

How are you running it?

From terminal directly: error as above.
From Intune- error "Script failed to run".
What am I missing?

I'm honestly a bit lost as to what you're doing wrong. When you say 'directly from terminal' can you tell me precisely what you're typing in terminal?

sudo sh installAcrobatDC.sh
also tried without sudo

Ahh, try sudo ./installAcrobatDC.sh the sh is calling the default shell which is ZSH.

Ahh, try sudo ./installAcrobatDC.sh the sh is calling the default shell which is ZSH.

NIIIIIIICE! Thank you very much friend, turns out it was a simple shell case. Thanks again.

No worries and really sorry it took so long to figure out!