Editing Text-Files on Unix

There are many programs for editing ASCII-text files available for Unix systems. Note that the character-encoding on CMS does not use ASCII, but EBCDIC, so you cannot simply transfer files between the two. When ftp-ing textfiles, make sure to always use ASCII mode! That is also important for transfers from/to Macs or PCs, as those have different end-of-line conventions than Unix.

the - the hessling-editor

Finally you have reached the point where Unix should look really familiar. While most Unix-aficionados use vi, emacs, or pico for editing purposes, here at UIC we have the - The Hessling-Editor! This program is extremely similar to your good old xedit, so you should have no trouble at all using it. We even have a pre-defined alias for the: you can simply type x filename to edit (or create) your file in the.

There are nevertheless differences between XEDIT and the - mostly those making the more powerful and userfriendly, e.g. better block copying features. Check out the computer center's the-resources. A useful article about the was also published in the A3C Connection.
Wait a moment! Whatever happened to the PROFILE XEDIT customization file you used to have on CMS? Well, on Unix, all customization files (also known as resource files) are system files, so their name starts with a period (dot). Besides, they almost always end in "rc". The file in which the (or x) stores its settings is called .therc and can be edited easily. Check here for details on getting the default .therc file.

pico - the pine composer

Once you have gotten used a bit to Unix, you may be ready for a mainstream editor, too. The reason you might want to learn pico is simple: it is the default editor for the email program pine, and it is simple to use, yet powerful. It automatically wraps long lines for you, and it displays frequently used commands at the bottom of the screen. Commands in pico are always combinations of a single letter with the Control-key (e.g. Ctrl-x, meaning you need to hold down Ctrl and hit x to exit). Frequently, you will see the Control-key denoted by a caret-symbol ^, so the exit-command is also denoted by ^X. While in general Unix is always case-sensitive, in pico case doesn't matter. Because pico is so easy to learn, there is rather little documentation for it, but IIT has a long and pretty complete one.

vi - the universal Unix editor

Unfortunately, pico is not installed on all Unix systems you may encounter (e.g. it is missing on daedalus, the former icarus machine). Enter vi, the most widespread application in the Unix world. vi foobar opens file foobar for editing and creates it if it didn't exist. But wait - in vi you can't simply start typing! Letters typed on the keyboard are interpreted as commands, not as text. To actually insert text, type i at the position where you would like to insert something, or a for appending text after the current letter. These two commands get you into insert mode, but to get out, you have to hit the Esc key (if you hit it without being in insert mode, it will just beep at you). You delete a letter by x-ing it out, a word via dw, and a line via dd (don't ask for an explanation of that one). vi takes time to master, but for power users it is indispensable. Here are some Introductions to vi from our Computer Center, from IIT, and from Colorado State University. Finally, a tutorial with all the advanced options from University of Hawaii.

emacs - the C-programmer's

integrated development environment

emacs really isn't for the ordinary user, but its multitude of features and shortcuts, as well as its tight integration with the gnu C-compiler, make it an extremely useful tool for power programmers. pico was actually designed as a very simplified version of emacs. The GNU EMACS manual is a book, slightly more readable is the documentation for MicroEMACS.