Assuming bash as the default shell, you did not call `shopt -s extglob`, so `!(pattern)` is unsupported.
Unrelated to Jenkins. On Tue, Nov 26, 2019 at 2:48 PM judaondo <[email protected]> wrote: > I am executing the following script: > > sh label: "<-- Zipping files -->", script: "cd > ${JENKINS_HOME}/userContent/myfiles/; zip myzip.zip *; ls -alh; sleep 30s; > rm !(myzip.zip)" > > But I am getting the following error: > > durable-dbed1d4d/script.sh: Syntax error: "(" unexpected > > > I have also tried adding sheblang but it doesn´t work neither: > > #!/bin/bash > > Any workaround to fix this please? > > -- > You received this message because you are subscribed to the Google Groups > "Jenkins Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jenkinsci-users/c5970e0b-4edb-4624-b9fc-5baee2fcbc63%40googlegroups.com > <https://groups.google.com/d/msgid/jenkinsci-users/c5970e0b-4edb-4624-b9fc-5baee2fcbc63%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- Daniel Beck Senior Software Engineer CloudBees, Inc. [image: CloudBees-Logo.png] -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAMo7Pt%2B%3D0PjzvJ8S12wqN-pT%2BN62_E1aupyag0YfrLohkc%3DS_Q%40mail.gmail.com.
