Regarding Swap memory usahe monitot via shell script
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
thanks for the suggestion. we are in restricted environment where third party application/software cant be installed.
or else would have been tried.
thanks for advice,will be try using it in other environment.
you do not need to install shellcheck, it is an online tool which can be used within a browser. Or as a standalone app without installation, if downloaded.
Anyway it is much faster than posting to a forum and waiting for an answer.
Last but not least you need to learn and understand what's going on, otherwise you will hardly be able to implement anything. Go step by step.
For example based on post #13 you can check what will be stored in the variable swap.
Next you can check how an if construct works and how can you write a conditional expression.
Hi New to forum and Linux too..and was not knowing that i can show gratitude by clicking on green button. So was marking it as helpful.
Thanks for the suggestion.
No need, but you do need to pay attention and apply what you're told. This thread was almost IDENTICAL to your other thread, and you've been told about the 'team' before as well.
It's not really necessary to do all this $SWAP stuff - Linux would tell you if you if things had got critical.
You would most likely get only a few seconds to identify and kill a runaway process before the machine crashes.
As pan64 points out, you can syntax check using online tools.
In my signature is a blog about bash debugging, it also contains bash references.
There's a ton you can do just using various coding and debugging techniques in your script.
As TB0ne notes, you have to do these diagnostics on your own to learn them. My thought processes when I hit a coding challenge is that I remind myself that a lot of people can likely do this stuff nearly in their sleep, and that it is not rocket science, so I can do it myself.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.