0

This may be a dumb question, but I cannot figure it out. Doing gjslint --help does not provide the answer, and --version is not a valid flag.

Any ideas?

powtac
  • 40,542
  • 28
  • 115
  • 170
pocketfullofcheese
  • 8,427
  • 9
  • 41
  • 57

2 Answers2

4

Run this command:

cat `which gjslint` | grep [0-9] --color=always

or

cat $(which gjslint) | grep [0-9] --color=always
Zabba
  • 64,285
  • 47
  • 179
  • 207
  • to find the path to gjslint use "which gslint" – powtac Jun 10 '11 at 20:59
  • @powtac, thanks. I had realized there would be a better way, so I [asked on AskUbuntu](http://askubuntu.com/questions/48149/how-to-cat-filename-returned-by-which/48150#48150) and learnt something new! – Zabba Jun 10 '11 at 21:01
  • I'm not sure, is `grep [0-9]` enough? – powtac Jun 10 '11 at 21:10
  • It's barely enough to *highlight* the numbers in that file. My bashrc was set up with color always on for grep. I'll update the answer in case the OP does not have that enabled! – Zabba Jun 10 '11 at 21:13
  • Did you run the complete command I mention in my answer? What was your result? I ran it on my box and it highlighted the version number. I don't understand why you downvoted it. – Zabba Jun 11 '11 at 01:43
  • Zabba! Sorry, you are right! I should have tried the whole command. My vote is locked, but if you just briefly edit your answer I can change my vote. I will upvote. Apologies, and thanks! – pocketfullofcheese Jun 12 '11 at 23:38
0

This one-liner prints out only the version number, convenient eg. if you want to use it in a script:

which gjslint | xargs cat | grep "ENTRY-SCRIPT" | sed 's|.*closure-linter==\([.0-9]*\).*|\1|'
Paul S.
  • 1,583
  • 1
  • 11
  • 14