Entering Commands into a program

37 views
Skip to first unread message

Akiva Lane

unread,
Feb 13, 2017, 3:02:14 AM2/13/17
to Jenkins Users
We have written a Java program that accepts command line input. 
I can start the program withe Jenkins, and then the program expects a command with parameters
to be entered.  But when I put the command on the next Jenkins line, Jenkins says 'command not found'.

For example, I run a script called startPgm that starts my program, and then need to enter the command
to the program "file javatest".

My Jenkins lines are:
+ cd /users/akiva
+ ./startPgm
+ file javatest

Jenkins starts the program, and then says:

Command> + file javatest
/tmp/hudson7645987865sh line 3:  file: command not found

How do I enter the command into the program?
Thanks.


Baptiste Mathus

unread,
Feb 17, 2017, 7:14:05 AM2/17/17
to jenkins...@googlegroups.com
You mean that program you wrote reads standard input, instead of taking parameters ?

--
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 jenkinsci-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/20ee9d79-02ff-4e98-aeef-fbf6075ab279%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ioannis Moutsatsos

unread,
Feb 22, 2017, 7:10:41 AM2/22/17
to Jenkins Users
Why not capture your Java command line parameters using a Jenkins freestyle build and a form for the required parameters?
These parameters are available in the build and can be passed to your java program.
Reply all
Reply to author
Forward
0 new messages