Compile and build with single command line Java (Linux)
问题 Is there way to set up an alias in such a way so that I could enter the command, followed by the argument in a single line? For example, instead of javac Program.java && java Program I would be able to go newcommand Program.java //or "newcommand Program", whichever is easier which would do the same commands as the line above. 回答1: An alias is not made to accept parameters, define a function like this: jcar() { javac $1.java && java $1 ; } Then use it: jcar Program ( jcar was intended as an