Power Tool
A simple script is usually enough to automate a knotty task in Linux, but with some simple shell commands and a little effort, you can convert a simple batch file into a robust shell program.
|
© KrishnaKumarSivaraman - 123RF.com
A simple script is usually enough to automate a knotty task in Linux, but with some simple shell commands and a little effort, you can convert a simple batch file into a robust shell program.
Sometimes you need things fast; when the search for a needed tool leads to a dead end, a knowledgeable Linux user can usually cobble together a program with a few lines of shell code. However, putting a bit more time into the quickly developed script could result in a robust program.
One example is the famous Windows "Snipping Tool" that captures sections of a screen and opens, saves, or copies them to the clipboard for use in another program. The same function is easily programmed in Linux. With a bit of effort, you can create a full-fledged tool that you can integrate into your desktop as a keyboard shortcut or as an item in the start menu or taskbar.
The basis for the present project is the import tool [1] from the powerful ImageMagick [2] command-line graphics suite. The introduction on its man page is enough to give you an idea of its capabilities: It captures a single window, the whole screen, or any rectangular portion thereof and saves it as a graphics file or sends it to standard output, from which you can pipe it to another command.
[...]
Pages: 4
The Shell Script Compiler converts scripts into binaries, which protects against accidental changes but also carries some pitfalls.
Keeping an eye on possible changes to the filesystem can prove very beneficial. It can also help you to automate many processes.
Many Linux beginners stumble over the fact that you need to precede any calls to your own scripts or programs with a ./ combination. What's up with these dot-slashes?
Does the ingenious script your wrote last month look like confusing spaghetti code today? We show some proven style guidelines that can provide order and readability.
The moreutils package expands the standard tools for the shell with useful and sometimes exotic tools.
© 2025 Linux New Media USA, LLC – Legal Notice