Features of the TCSH Shell
In this article, I will describe some of the main features of TCSH, which I believe make it worth using as the primary log in shell. This article is not meant to persuade bash users to change. I've never used bash, so I know very little about it.
As some of you know, I've created a configuration tool called The Dotfile Generator, http://www.imada.ou.dk/~blackie/dotfile/, which can configure TCSH. I believe that this tool is very handy for getting the most out of TCSH without having to read the manual a couple of times. Therefore, I'll refer to this tool several times throughout this article to show how it can be used to set up TCSH.
The shell is your interface to executing programs, managing files and directories, etc. Though very few people are aware of it, they use the shell frequently in daily work, e.g., completing file names, using history substitution and aliases. The TCSH shell offers all of these features and a few more, which the average user seldom optimizes.
With a high knowledge of your shell's power, you can decrease the time you need to spend in the shell, and increase the time spent on original tasks.
An important feature used by almost all users of a shell is command line completion. With this feature you don't need to type all the letters of a file name—just the ambiguous ones. This means that if you wish to edit a file called file.txt, you may need to type only fi and press the TAB key, and the shell will type the rest of the file name for you.
Basically, one can use completion on files and directories. This means that you cannot use completion on host names, process IDs, options for a given program, etc. Another thing you cannot do with this type of completion is to complete directory names when typing the argument for the command cd.
In TCSH the completion mechanism is enhanced, so that it is possible to tell TCSH which list to use to complete a particular command. For example, you can tell TCSH to complete from a list of host names for the commands rlogin and ping. An alternative is to tell it to complete only on directories when the command is cd.
To configure user-defined completion using The Dotfile Generator (TDG), go to the TDG page completion -> userdefined; this will bring up a page which looks like Figure 1.
For the command name, you tell TDG which command you wish to define a completion for. In this example it is rm.
Next you have to tell TDG to which arguments to the command this completion applies. To do this, press the button labeled Position definition. This will bring up a page, which is split into two parts as shown in Figures 2 and 3.
In the first part, you tell TDG the position definition that should be defined from the index of the argument to be completed (i.e., the one where the TAB key is pressed). Here you can tell it that you wish to complete on the first argument, all the arguments except the first one, and so forth.
2066f3.gifFigure 3. TDG Pattern Definition Page
The alternative to “position-dependent completion” is “pattern-dependent completion”. This means that you can tell TDG that this completion should only apply if the current word, the previous word or the word before the previous word conform to a given pattern.
Now you have to tell TDG which list to complete from. To do this, press the button labeled List. This will bring up a page where you can select from a lot of different lists, e.g., aliases, user names or directories.
Four of the lists you can select from are Commands, Directories, File names and Text files. If you select one of these, only elements from that directory are used.
There are two ways to specify completion from a predefined list. One is to mark the option predefined list, and type all the options in this list.
This solution is a bad idea if the list is used in several places (e.g., a list of host names). In that case, one should select the list to be located in a variable, then set this variable in the .tcshrc file.
Fast/Flexible Linux OS Recovery
On Demand Now
In this live one-hour webinar, learn how to enhance your existing backup strategies for complete disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible full-system recovery solution for UNIX and Linux systems.
Join Linux Journal's Shawn Powers and David Huffman, President/CEO, Storix, Inc.
Free to Linux Journal readers.Register Now!
- Server Hardening
- May 2016 Issue of Linux Journal
- EnterpriseDB's EDB Postgres Advanced Server and EDB Postgres Enterprise Manager
- The Humble Hacker?
- BitTorrent Inc.'s Sync
- The Death of RoboVM
- The US Government and Open-Source Software
- New Container Image Standard Promises More Portable Apps
- Open-Source Project Secretly Funded by CIA
- ACI Worldwide's UP Retail Payments
In modern computer systems, privacy and security are mandatory. However, connections from the outside over public networks automatically imply risks. One easily available solution to avoid eavesdroppers’ attempts is SSH. But, its wide adoption during the past 21 years has made it a target for attackers, so hardening your system properly is a must.
Additionally, in highly regulated markets, you must comply with specific operational requirements, proving that you conform to standards and even that you have included new mandatory authentication methods, such as two-factor authentication. In this ebook, I discuss SSH and how to configure and manage it to guarantee that your network is safe, your data is secure and that you comply with relevant regulations.Get the Guide