Skip to content
Advertisement

In a ksh script find value of latest file/jar and save to a variable

I am a self-confessed beginner level when it comes to RHEL and I can navigate around, find things, run things etc. And I only have basic permissions on my DEV, INT, PROD and BCP servers at my client as most of my time is taken up in complex development.

I use ksh scripts to launch Tomcat, and for the new version of my project it is a SpringBoot launchable JAR file. New deployments will feature a dynamically changing jar/file name deployed from Nexus such that instead of the fixed name (in the older Tomcat setup for exploded folder in /webapps) I will need to look it up as it’ll have a changing version number at the end.

I came up with this:

JavaScript

Which works on CLI, so I added it to my launch ksh file (which worked previously with fixed jar name) like so:

JavaScript

However this gives the error, when ksh is run, of ‘jartolaunch not found’.

Advertisement

Answer

Change:

JavaScript

to:

JavaScript

or better:

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement