I’ve a custom java executable jar file - mytestapp.jar, which performs some basic checks like system name, ip address, canonical name, uptime etc and prints the same in customized formant on the screen. The program is working fine and I get the required and expected out put when i run
java -jar /mytestapp/mytestapp.jar
Instead of running the above command each time, I’ve created a file myappinfo and added the above command in the file and saved it. Added /mytestapp to the PATH variable. When I do echo $PATH, it displays /mytestapp in the PATH.
I set the file permissions of myappinfo to 755 and made it executable.
Now when I run the command myappinfo from any folder I get the same output.
Now the requirement is,
I want to make this file – myappinfo to be a binary file, not to be changed or inspected by anyone by using any editor programs (like vi, nano, etc). Any advise to do this?
Just setting the shell script to not world readable/writeable should do what you want.
But if you insist that you want to convert your shell script into a compiled shell script there is shc which claims to do just this.
I am sure if you Google for
shell script compileryou will find many other options as well. This is just the one I know about.