0

I have a java file called 'move.class' I want to make it into a bash command so people can call it from the bash terminal, input options or parameters, and read its manual page:

People should be able to use this like any other command:

$ sudo move | more

I need to read the arguments and parameters (in java)

$ move -i --string=HELLO file1 fil2

I also need it to have a man page so a user can say:

$ man move

To get comprehensive instructions on how to use this command.

0

2 Answers 2

2

Create shell script move. Something like following:

java -cp yourjar.jar com.yourcompany.move.Main $*

Put this script to location that is in the path of most users. For example /sbin.

Now the command should work. This is the time to refer to this or similar tutorial that explains how to create man pages.

Sign up to request clarification or add additional context in comments.

2 Comments

Agreed, and I think the | more will take whatever you output by using System.out.println()
He would probably want "$@" (quoted) as $* would not work with args that contain a space.
0

id suggest using the alias command. Something like

alias move="java yourClass"

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.