by Satish Kumar | Jan 28, 2021 | BASH
Select works using a provided list (for example, it can be a wildcard selection for files) and will give you a list, such as: Select a file from the list: 1.) myfirst.file 2.) mysecond.file You chose: mysecond.file Clearly, a menu such as about is very trivial; it can...
by Satish Kumar | Jan 27, 2021 | BASH
One of the best practices for scripts (or programs, for that matter) is controlling user input, not only for security, but for controlling functionality in a way that input provides predictable results. For example, imagine a user who enters a number instead of a...
by Satish Kumar | Jan 25, 2021 | Linux
Running as root is dangerous, although sometimes convenient—especially when you are new to Linux and password prompts seem to be a hassle. So far, as a Linux user, you may have seen the sudo command or the su command. These commands can allow a user to change users on...
by Satish Kumar | Jan 24, 2021 | BASH
Leading up to getting our scripts to run as daemons, we need to know how to keep commands running after a user logs off (or better yet, have them started by the system itself (we will look at this in more detail later). When a user logs in, a session for that user is...
by Satish Kumar | Jan 23, 2021 | BASH
This is great for single use scripts, but what about if we wanted to have scripts execute multiple scripts through a menu, or perform tasks in the background automatically forever without being executed each time by scheduling processes (like cron)? This recipe...