Installing a Shell Script

A shell script is a file that contains commands written in a shell command language . You run (or "execute") a script as you would any other command. First, make sure that the script file is executable; if it isn't, you won't be able to execute it .

Making Abbreviations in Emacs

An abbrev is a word that is an abbreviation of a (usually) longer word or phrase. Abbrevs exist as a convenience to you−−you can define abbrevs to expand to a long phrase that is inconvenient to type, or you can define a misspelling that you tend to make to expand to its correct spelling. Abbrevs only expand when you have Abbrev mode enabled.

Recording and Running Macros in Emacs

A macro is like a recording of a sequence of keystrokes−−when you run a macro, Emacs executes that key sequence as if you had typed them. To begin recording a macro, type C−x (. Then, everything you type is recorded as the macro until you stop recording by typing C−x ). After you have recorded a macro, you can play it back at any time during the Emacs session by typing C−x e. You can precede it with the universal−argument command, C−u, to specify a number of times to play it back.

How do I write a simple shell script?

Create a text (ASCII) file that is to contain the shell script. For example, I would use the pico editor to write a script that runs the program tar with all the parameters usually necessary to uncompress a tarball downloaded from the Internet (I never seem to remember the tar options). I decided to call my script "untar":

How do I write a simple GUI program (using Tk)?

Tk is a GUI extension of the easy yet powerful tcl programming language. For example, I may use pico to create a text file that will contain a simple tk program:

pico try_tk

How do I compile a simple C program?

Start your favourite text editor and type in your source code. For example, I may use pico:

pico hello.c

Bash flow controls

GNU’s bash (Bourne Again Shell, named in punning homage to the Bourne shell and its author, Steven Bourne) is Linux’s default shell. Written by Brian Fox and maintained by Chet Ramey, bash’s most popular features are its rich command-line editing facilities and its job control abilities. From the programmer’s perspective, bash’s chief advantages are its customizability and the complete programming environment it provides, including function definitions, integer math, and a surprisingly complete I/O interface. As you might expect of a Linux utility, bash contains elements of all of the popular shells, Bourne, Korn, and C shell, as well as a few innovations of its own. As of this writing, the current release of bash is 4.*. Most Linux distributions, however, use an older version version. In this article we will have a quick look on flow controls.

Which are the wildcars in Linux?

bash’s wildcard operators are *, ?, and the set operators, [SET] and [!SET]. * matches any string of characters and ? matches any single character. Suppose you have a directory containing the following files:

Special Characters

The wildcard and set operators are four examples of bash’s special characters - characters that have a specific meaning to bash. In this article  all special characters are listes, with a brief description of each one.

Items 1 - 9 of 9 displayed.

Back to Home page