I am executing parameterised build in jenkins to count no. of lines in file which has 1 file parameter. Its file location is pqr
. The name of the script file is linecount.sh
which is saved at remote server. When i tried to execute it using command sh linecount.sh
filename, it works perfectly from jenkins. But as i remove filename from the argument and execute same script as parameterised build it is showing below error on console :
Started by user Prasoon Gupta
[EnvInject] - Loading node environment variables.
Building in workspace users/Prasoon/sample_programs
Copying file to pqr
[sample_programs] $ /bin/sh -xe /tmp/hudson3529902665956638862.sh
+ sh linecount.sh
PRASOON4
linecount.sh: line 15: parameterBuild.txt: No such file or directory
Build step 'Execute shell' marked build as failure
Finished: FAILURE
I am uploading file (parameterBuild.txt
) from my local machine. Why is it giving this error?
My doubt is in shell script I used argument as $1
. How can I refer this when I am taking file as parameter.
ls -l
in your shell command. – Jon Sls -l
as part of your shell command in the job configuration? E.g. does it listparameterBuild.txt
there or any other files? – Jon S