unix lint utility with java, using pipes

Colin Watson cjwatson at ubuntu.com
Mon Apr 4 10:22:23 UTC 2016


On Mon, Apr 04, 2016 at 09:58:28AM +0000, thufir wrote:
> I was perusing the tee utility, and came across this example:
> 
> lint program.c | tee program.lint
[...]
> can lint be used with java, instead of a c program?  Or, would you need a 
> c program to invoke the java program?

The classic lint was C-only; you'd need a Java equivalent.  A linter
fundamentally needs to understand the target language in quite a bit of
detail, so don't expect to find a generic one that can operate on a
variety of different languages.

> lint foo.jar | program.lint

In the original example, "program.lint" was a file name in which the
output was saved, not an executable program.  You'd either want to
redirect output using ">", simultaneously pass through and redirect
output using "| tee", or pass the output file name directly to the
linter without shell metacharacters if the linter supports being given
an output file name that way.

-- 
Colin Watson                                       [cjwatson at ubuntu.com]




More information about the ubuntu-users mailing list