Feature
| Browse in : |
All
> Topics
> Shell & CLI |
- Options :
- View Archives
Note: when you create a new publication type, the articles module will automatically use the templates user-display-[publicationtype].xd and user-summary-[publicationtype].xd. If those templates do not exist when you try to preview or display a new article, you'll get this warning :-) Please place your own templates in themes/yourtheme/modules/articles The templates will get the extension .xt there.
Patterns and string processing in shell scripts
Lee Schlesinger
December 26, 2008 2:00:00 PM
Shell programming is heavily dependent on string processing. The term string is used generically to refer to any sequence of characters; typical examples of strings might be a line of input or a single argument to a command. Users enter responses to prompts, file names are generated, and commands produce output. Recurring throughout this is the need to determine whether a given string conforms to a given pattern; this process is called pattern matching. The shell has a fair amount of built-in pattern matching functionality.
Note: when you create a new publication type, the articles module will automatically use the templates user-display-[publicationtype].xd and user-summary-[publicationtype].xd. If those templates do not exist when you try to preview or display a new article, you'll get this warning :-) Please place your own templates in themes/yourtheme/modules/articles The templates will get the extension .xt there.
Debug your shell scripts with bashdb
Lee Schlesinger
November 24, 2008 6:00:00 PM
The Bash Debugger Project (bashdb) lets you set breakpoints, inspect variables, perform a backtrace, and step through a bash script line by line. In other words, it provides the features you expect in a C/C++ debugger to anyone programming a bash script.
Note: when you create a new publication type, the articles module will automatically use the templates user-display-[publicationtype].xd and user-summary-[publicationtype].xd. If those templates do not exist when you try to preview or display a new article, you'll get this warning :-) Please place your own templates in themes/yourtheme/modules/articles The templates will get the extension .xt there.
More tricks with BashDiff
Lee Schlesinger
October 29, 2008 6:00:00 PM
Yesterday we took a look at BashDiff, a patch for the bash shell that adds new capabilities. We've already looked at some of the additions that BashDiff makes to bash's commands and string parsing abilities. Today we'll look at modifying positional parameters, parsing XML, talking to ISAM and relational databases, creating GTK+2 GUIs, and a few other tricks and issues.
Note: when you create a new publication type, the articles module will automatically use the templates user-display-[publicationtype].xd and user-summary-[publicationtype].xd. If those templates do not exist when you try to preview or display a new article, you'll get this warning :-) Please place your own templates in themes/yourtheme/modules/articles The templates will get the extension .xt there.
Teach an old shell new tricks with BashDiff
Lee Schlesinger
October 27, 2008 3:00:00 PM
BashDiff is a patch for the bash shell that can do an amazing number of things. It extends existing bash features, brings a few of awk's tricks into the shell itself, exposes some common C functions to bash shell programming, adds an exception mechanism, provides features of functional programming such as list comprehension and the map function, lets you talk with GTK+2 and databases, and even adds a Web server right into the standard bash shell.
Note: when you create a new publication type, the articles module will automatically use the templates user-display-[publicationtype].xd and user-summary-[publicationtype].xd. If those templates do not exist when you try to preview or display a new article, you'll get this warning :-) Please place your own templates in themes/yourtheme/modules/articles The templates will get the extension .xt there.
Save time at the command line with shell aliases and functions
Lee Schlesinger
September 16, 2008 9:00:00 AM
Familiarity with command prompts and shell scripts is still necessary if you want to get the most from your GNU/Linux system, but the less time you spend doing that the better, right? Two powerful ways to minimize your time at the command line are shell aliases and functions.
Note: when you create a new publication type, the articles module will automatically use the templates user-display-[publicationtype].xd and user-summary-[publicationtype].xd. If those templates do not exist when you try to preview or display a new article, you'll get this warning :-) Please place your own templates in themes/yourtheme/modules/articles The templates will get the extension .xt there.
Scheduling jobs based on filesystem activity with incron
roblimo
August 20, 2008 7:00:00 PM
There are numerous documents, tutorials and guides detailing the workings and usage of cron, the de facto tool for scheduling jobs on Linux. While traditional cron jobs are executed at set times, inotify cron, or incron, is a cron clone that watches the filesystem for specified changes and executes the relevant commands. You can set incron to monitor a particular file or directory for changes and schedule jobs for when those changes occur.
Note: when you create a new publication type, the articles module will automatically use the templates user-display-[publicationtype].xd and user-summary-[publicationtype].xd. If those templates do not exist when you try to preview or display a new article, you'll get this warning :-) Please place your own templates in themes/yourtheme/modules/articles The templates will get the extension .xt there.
CLI Magic: For geek cred, try these one-liners
Lee Schlesinger
July 23, 2008 9:00:00 AM
In this context, a one-liner is a set of commands normally joined through a pipe (|). When joined by a pipe, the command on the left passes its output to the command on the right. Simple or complex, you can get useful results from a single line at the bash command prompt.
Note: when you create a new publication type, the articles module will automatically use the templates user-display-[publicationtype].xd and user-summary-[publicationtype].xd. If those templates do not exist when you try to preview or display a new article, you'll get this warning :-) Please place your own templates in themes/yourtheme/modules/articles The templates will get the extension .xt there.
Bringing the trashcan to the command line
Lee Schlesinger
June 17, 2008 9:00:00 AM
The trash project allows you to interact with your desktop trashcan from the command line. It lets users "undo" deletions made with the trash command in a similar manner to restoring files from the trashcan in a desktop environment. For experienced Linux users, the trash command comes in handy when you want to put a file into the trashcan from the command line.
Note: when you create a new publication type, the articles module will automatically use the templates user-display-[publicationtype].xd and user-summary-[publicationtype].xd. If those templates do not exist when you try to preview or display a new article, you'll get this warning :-) Please place your own templates in themes/yourtheme/modules/articles The templates will get the extension .xt there.
A utility for sending complex email messages from the command line
Lee Schlesinger
June 06, 2008 9:00:00 AM
When the need arises to send email from the command line, many folks first think of the mail(1) command. A better choice might be the email program, which gives you the ability to send email to an SMTP server over SSL, offers MIME support including ability to attach one or more files to your emails, uses an address book to store your recipients, and lets you digitally sign and encrypt your messages.
Note: when you create a new publication type, the articles module will automatically use the templates user-display-[publicationtype].xd and user-summary-[publicationtype].xd. If those templates do not exist when you try to preview or display a new article, you'll get this warning :-) Please place your own templates in themes/yourtheme/modules/articles The templates will get the extension .xt there.
Transform images into videos with images2mpg
Lee Schlesinger
June 04, 2008 4:00:00 PM
images2mpg, a simple utility that's part of the KDE Image Plugin Interface (KIPI), lets you create an MPEG file from image files. Relying on a handful of command-line tools including the ImageMagick suite and mjpegtools, images2mpg creates wonderful videos from your images and even lets you insert your favorite song as the background. It supports SVCD, DVD, VCD, and XVCD video formats.
Note: when you create a new publication type, the articles module will automatically use the templates user-display-[publicationtype].xd and user-summary-[publicationtype].xd. If those templates do not exist when you try to preview or display a new article, you'll get this warning :-) Please place your own templates in themes/yourtheme/modules/articles The templates will get the extension .xt there.
Terminator runs multiple GNOME terminals in the same window
Lee Schlesinger
May 14, 2008 4:00:00 PM
In a sense, the desktop is the best thing that ever happened to the command line. Because a virtual terminal runs in a graphical environment, it boasts all sorts of enhancements that the unadorned shell lacks -- everything from multiple tabs to easy selection of display fonts and background and foreground colors. Perhaps the resulting power and convenience explains why, even at a time when the emphasis is on giving every application a graphical interface -- no matter how inappropriately -- people still write useful utilities for virtual terminals. A good example is Terminator, a program designed to perform one simple function: displaying multiple instances of the GNOME terminal within the same window.
Note: when you create a new publication type, the articles module will automatically use the templates user-display-[publicationtype].xd and user-summary-[publicationtype].xd. If those templates do not exist when you try to preview or display a new article, you'll get this warning :-) Please place your own templates in themes/yourtheme/modules/articles The templates will get the extension .xt there.
Korn -- an extended shell
Lee Schlesinger
May 05, 2008 4:00:00 PM
Everyone knows what a Linux shell is -- you open up a Linux terminal window (such as Konsole or xterm), type in some commands, and there you are, using your Linux shell. Write your commands to a file, make it executable, run it, and you're a shell programmer. But did you know that there are different shells that you can use, and that each shell operates in a slightly different way? My personal favorite is the Korn shell; by the end of this article, it may be your favorite as well.
Note: when you create a new publication type, the articles module will automatically use the templates user-display-[publicationtype].xd and user-summary-[publicationtype].xd. If those templates do not exist when you try to preview or display a new article, you'll get this warning :-) Please place your own templates in themes/yourtheme/modules/articles The templates will get the extension .xt there.
CLI Magic: A little script to customize directory listings
Lee Schlesinger
December 11, 2007 9:00:00 AM
Sometimes when I run ls to get a directory listing, I am looking for a specific file, but I want to see the whole context where the file resides. While you can pipe the output of ls to grep, that doesn't show you the whole directory with the matched files highlighted in a different color. I create a small script to do just what I want.
Note: when you create a new publication type, the articles module will automatically use the templates user-display-[publicationtype].xd and user-summary-[publicationtype].xd. If those templates do not exist when you try to preview or display a new article, you'll get this warning :-) Please place your own templates in themes/yourtheme/modules/articles The templates will get the extension .xt there.
GNU Emacs 22 finally released
Joe Barr
June 04, 2007 11:50:00 PM
Emacs fans, limber up your fingers -- there's a new GNU in town. Almost six years after the release of the previous version, the Free Software Foundation has announced the release of GNU Emacs 22. (Actually, 22.1, but who's counting?) This release includes support for GTK+, drag and drop support for X, a number of new modes, and a graphical interface to the GNU Debugger (GDB).