Fatal error with Execute shell!

Hey,
I have a problem:
When I create a project and click on “Build” and select Execute shell and build the project -
I got an error in the console output

Started by user admin
Running as SYSTEM
Building in workspace /var/lib/jenkins/workspace/GSystem-Frontend
The recommended git tool is: NONE
using credential 9f570181-48ee-411a-aecc-b60be335cfe7
 > /usr/bin/git rev-parse --resolve-git-dir /var/lib/jenkins/workspace/GSystem-Frontend/.git # timeout=10
Fetching changes from the remote Git repository
 > /usr/bin/git config remote.origin.url https://github.com/Justinyeh0530/GSKY_System.git # timeout=10
Fetching upstream changes from https://github.com/Justinyeh0530/GSKY_System.git
 > /usr/bin/git --version # timeout=10
 > git --version # 'git version 2.34.1'
using GIT_ASKPASS to set credentials ny
 > /usr/bin/git fetch --tags --force --progress -- https://github.com/Justinyeh0530/GSKY_System.git +refs/heads/*:refs/remotes/origin/* # timeout=10
 > /usr/bin/git rev-parse refs/remotes/origin/login-frontend^{commit} # timeout=10
Checking out Revision 0663ec7e146120690ec9c3dc3b9832ec01a881c8 (refs/remotes/origin/login-frontend)
 > /usr/bin/git config core.sparsecheckout # timeout=10
 > /usr/bin/git checkout -f 0663ec7e146120690ec9c3dc3b9832ec01a881c8 # timeout=10
Commit message: "增加註冊功能"
 > /usr/bin/git rev-list --no-walk 0663ec7e146120690ec9c3dc3b9832ec01a881c8 # timeout=10
[GSystem-Frontend] $  /bin/bash /tmp/jenkins13985839519266377201.sh
FATAL: command execution failed
java.io.IOException: error=2, No such file or directory
	at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
	at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:314)
	at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:244)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1110)
Caused: java.io.IOException: Cannot run program "" (in directory "/var/lib/jenkins/workspace/GSystem-Frontend"): error=2, No such file or directory
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1143)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1073)
	at hudson.Proc$LocalProc.<init>(Proc.java:252)
	at hudson.Proc$LocalProc.<init>(Proc.java:221)
	at hudson.Launcher$LocalLauncher.launch(Launcher.java:994)
	at hudson.Launcher$ProcStarter.start(Launcher.java:506)
	at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:144)
	at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:92)
	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:818)
	at hudson.model.Build$BuildExecution.build(Build.java:199)
	at hudson.model.Build$BuildExecution.doRun(Build.java:164)
	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:526)
	at hudson.model.Run.execute(Run.java:1895)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:44)
	at hudson.model.ResourceController.execute(ResourceController.java:101)
	at hudson.model.Executor.run(Executor.java:442)
Build step 'Execute shell' marked build as failure
Finished: FAILURE

11

There is a syntax error in your shell script. The first line that you show has a space character in it that is unexpected.

Instead of:

#! /bin/bash -ex

you want

#!/bin/bash -ex