Hello everyone,

How can I execute shell scripts from jenkins? 

I have the below code in "Execute Shell" command
""
#!/bin/bash
echo "hello"

Received the following Error Msg  in the console.

Running as SYSTEM Building on master in workspace 
C:\Users\crnat\.jenkins\workspace\ssh-task-test [ssh-task-test] $ /bin/bash 
C:\Users\crnat\AppData\Local\Temp\jenkins563122492098989130.sh The system 
cannot find the file specified FATAL: command execution failed 
java.io.IOException: CreateProcess error=2, The system cannot find the file 
specified at java.lang.ProcessImpl.create(Native Method) at 
java.lang.ProcessImpl.<init>(Unknown Source) at 
java.lang.ProcessImpl.start(Unknown Source) Caused: java.io.IOException: 
Cannot run program "/bin/bash" (in directory 
"C:\Users\crnat\.jenkins\workspace\ssh-task-test"): CreateProcess error=2, 
The system cannot find the file specified at 
java.lang.ProcessBuilder.start(Unknown Source) at 
hudson.Proc$LocalProc.<init>(Proc.java:252) at 
hudson.Proc$LocalProc.<init>(Proc.java:221) at 
hudson.Launcher$LocalLauncher.launch(Launcher.java:996) at 
hudson.Launcher$ProcStarter.start(Launcher.java:508) 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:803)
 
at hudson.model.Build$BuildExecution.build(Build.java:197) at 
hudson.model.Build$BuildExecution.doRun(Build.java:163) at 
hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:513) 
at hudson.model.Run.execute(Run.java:1906) at 
hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at 
hudson.model.ResourceController.execute(ResourceController.java:97) at 
hudson.model.Executor.run(Executor.java:429) Build step 'Execute shell' 
marked build as failure Finished: FAILURE


Thanks,
Poo

-- 
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/10cb3599-af93-4c8d-be6a-f95cd8879aadn%40googlegroups.com.

Reply via email to