ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have this script which straight forward installs an application with version 10 and since now there are version 10 and 11 I have changed it to install the version based on the number you pass to $1.However after testing in the case of version 11 recursion happened with the same file and this logic I cannot move to another file to call,however I decided to call the same file with additional parameter $2 with value for example "XYZ" ,it works correctly ,however is it a bad practise?
no code to peak at so... if it works without damaging anything and without errors, is that a bad thing?
it doesn't damage things,but for e.g in c++ where there is 1 parameter we cannot do this "trick" so I wondered if it is ok to use it or there is another way to get out of this situation minding the restriction I cannot call other .sh file and use the logic in the file
explain this part in detail, so I can make sure I am on the same page as you.
"version 11 recursion happened with the same file"
what recursion, it tried to install twice? Because to me, installing an app via a script, with a version change, not much different should take place. all that is needed is an check and assignment of the version number then place it where needed within the script, and the install process should be the same.
post the script if you like, to get a better idea of your logic.
I have read the question several times and cannot make a best guess at what is being asked - but others should not have to guess what the question is!
Please review the Site FAQ for guidance in posting your questions and general forum usage. Especially, read the link in that page, How To Ask Questions The Smart Way. The more effort you put into understanding your problem and framing your questions, the better others can help!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.