The Hamilton C Shell

Total Page:16

File Type:pdf, Size:1020Kb

The Hamilton C Shell The Hamilton Cshell perform frequently. On the other hand, it PRODUCT INFORMATION A command-line interface may be complex, its function and behavior based partly on command-line arguments, for OS/2 that borrows the environment, and user interaction. Hamilton C shell 1.03 A shell procedure may even be recur­ Hamilton Laboratories the power of Unix sive. For instance, I wrote a recursive 13 Old Farm Rd. Wayland, MA 01778-3117 procedure called "dirt" that pretty-prints (508) 358-5715 a directory tree using indentation to indi­ $350; requires IBM AT, PS/2, or compat­ cate common parentage. When called with ible; OS/2 1.1 with Presentation BY KENNETH G. GOUTAL no arguments, it prints the directory tree Manager from your current working directory on Inquiry 71 he Hamilton C shell is an implemen­ down. When called with one argument, it T tation under OS/2 version 1.1 of the prints the directory tree from the speci­ Unix C shell. The C shell is a command­ fied directory on down. When it calls This product appears to work perfectly line interpreter with commands for run­ itself recursively, it passes a subdirectory and exactly as described in the manual. It ning programs, spawning threads and and the current indentation as arguments. also works blindingly fast, for two rea­ processes, and manipulating directories Several commands can be "stacked" sons. First, it compiles commands and pro­ and files. It also has high-level program­ on a single command line. For instance, cedures before executing them, rather than ming constructs that allow you to exe­ slavishly interpreting them. Second, it cute those commands in other than cat * .txt >alltxt; we-w makes use of the OS/2 threads whenever simple sequential order. alltxt the Unix C shell would use processes. Users who are used to working with I did encounter some installation diffi­ Unix but are totally unfamiliar with OS/2 mncatenates all the files with the ex­ culties. This was due partly to my unfa­ will find that this tool eases the transition tension ". txt" into a file called "alltxt." It miliarity with OS/2, partly to some lack of greatly. With a couple of minor excep­ then counts the words in that file. clarity in the manual, and partly to the tions, the Hamilton C shell is an exact Commands can be "piped" together lack of a program to supervise the instal­ functional duplicate of the C shell found with a single command. For example, lation. It was not due to any bugs in the on Unix systems. The few exceptions are software or errors in the manual. clearly documented and are mostly a mat­ eat * . txt I we -w Hamilton Laboratories reports that, to ter of cleaning up ugly irregularities in date, it has a 24-hour turnaround time for the traditional C shell or adaptirVg to the does the same thing as the previous ex­ fixing serious bugs, with updates sent out OS/2 environment itself. ample, but without the need for an inter­ the next day. Based on the company's For example, the character used by mediate file. The output of the first com­ responsiveness when I called with some OS/2 to punctuate path names is the back­ mand is fed directly into the next. questions about installation, I'm inclined slash rather than the forward slash used A "history" mechanism makes short to believe this. The fixes to less serious by Unix. This precludes the use of the work of retyping commands either to cor­ bugs are included in subsequent releases. backslash to mean "take the next charac­ rect an error in the command just typed The company can be reached by phone, ter literally, and ignore any special mean­ or to reuse a complicated command is­ mail, or electronic mail. ing it usually has in the Unix C shell." sued several minutes or even hours be­ In conclusion, it looks like we have a OS/2 normally uses the caret for this pur­ fore. For example, ! eat reexecutes the winner. I expected to be put off by OS/2, pose, so the Hamilton C shell follows entire command line in the previous ex­ but after I got the Hamilton C shell in­ suit. As a result, the caret cannot be used ample; ! ! : s / t xt / 1 og does this again, stalled and tailored to my tastes, it was for short-form history substitution as it is except that it counts the words in all the just like being back home. I had some on the Unix C shell, and the percent sign files with the extension ".log" instead of difficulties at first adapting to the minor is used instead. However, these choices ". txt." ! 23 reexecutes the 23rd command incompatibilities with the Unix C shell, are controlled by environment variables, you had typed since starting the current but after that it was smooth sailing. I so if you really must use the characters copy of the Hamilton C shell. expect that someone who is not used to you're used to, you can. The Hamilton C shell provides several using the Unix C shell would actually OS/2 users who have never seen Unix useful utility programs as well as several have an easier time with the Hamilton C will benefit from the Hamilton C shell's built-in commands. The most common shell than with the Unix C shell. Natu­ interface, which is much more powerful Unix commands are proVided either as rally, it will take a while to learn how to than the CMD.EXE supplied with OS/2. built-in commands or as external utilities: exploit all of its power, but its features Control constructs include s w.i. L eh, rotd, sleep, SOULee, cat, ehmod, can be used independently and learned un til, and whi 1 e. Contrary to whatthe ep, date, du, Is, mkdir, more, only when necessary. There are some product name suggests, the syntax of these mY, pwd, rm, rmdir, tee, touch, improvements that could be made in the constructs is not much like that of the C and we. Others, such as awk, grep, and area of installation and in the manual, but programming language. It is, however, sed, are on the way. Some of these do the these are not prohibitive and may have faithful to the Unix C shell syntax. same things as commands in CMD.EXE, already been made by the time you read You can store a sequence of commands, some do the same things as other utilities this. All in all, the Hamilton C shell is a called a shell script, in a file and execute supplied with OS/2, while others have no much-needed and well-done product. _ the sequence with the souree command. OS/2 equivalent. For convenience, many You can also define shell procedures, common CMD.EXE commands and OS/2 which are stored within the shell itself utility names have been defined as ali­ Kenn Goutal is a technical support engineer at until you exit from it. A procedure may ases of the built-in commands and of the Interhase Software Corp. o/Bedjord, MA. He be a simple series of commands that you utilities included with the shell. can he reached via II11Gp as [email protected]. Reprinted with permission of MIPS Magazine © Copyright SEPTEMBER 1989 1989 by Computer Metrics, Inc. All rights reserved. MIPS .
Recommended publications
  • Shell Scripting with Bash
    Introduction to Shell Scripting with Bash Charles Jahnke Research Computing Services Information Services & Technology Topics for Today ● Introductions ● Basic Terminology ● How to get help ● Command-line vs. Scripting ● Variables ● Handling Arguments ● Standard I/O, Pipes, and Redirection ● Control Structures (loops and If statements) ● SCC Job Submission Example Research Computing Services Research Computing Services (RCS) A group within Information Services & Technology at Boston University provides computing, storage, and visualization resources and services to support research that has specialized or highly intensive computation, storage, bandwidth, or graphics requirements. Three Primary Services: ● Research Computation ● Research Visualization ● Research Consulting and Training Breadth of Research on the Shared Computing Cluster (SCC) Me ● Research Facilitator and Administrator ● Background in biomedical engineering, bioinformatics, and IT systems ● Offices on both CRC and BUMC ○ Most of our staff on the Charles River Campus, some dedicated to BUMC ● Contact: [email protected] You ● Who has experience programming? ● Using Linux? ● Using the Shared Computing Cluster (SCC)? Basic Terminology The Command-line The line on which commands are typed and passed to the shell. Username Hostname Current Directory [username@scc1 ~]$ Prompt Command Line (input) The Shell ● The interface between the user and the operating system ● Program that interprets and executes input ● Provides: ○ Built-in commands ○ Programming control structures ○ Environment
    [Show full text]
  • C Shell Scripts File Permissions a Simple Spelling Checker Command
    Cshell scripts Asimple spelling checker mylatex1.csh #!/bin/csh #!/bin/csh tr -cs "[:alpha:]" "[\n*]" < $1 \ latex file.tex |tr"[:upper:]" "[:lower:]" \ dvips -f file.dvi > file.ps |sort -u > tempfile rm file.aux file.dvi file.log comm -23 tempfile /usr/share/dict/words rm tempfile mylatex2.csh #!/bin/csh Put one word per line \ |convert everything to lowercase \ latex $1.tex |sor t the words,remove duplicates and write the result to ’tempfile’. dvips -f $1.dvi > $1.ps rm $1.aux $1.dvi $1.log Pr int those words in ’tempfile’ that are not in the dictionary. Remove the temporar y file. Graham Kemp,Chalmers University of Technology Graham Kemp,Chalmers University of Technology File permissions Command substitution in a script ls -l To include the output from one command within the command line for another command, enclose the command whose output is to be included rwxrwx rwx within ‘backquotes‘. For example: rwxr -xr -x #!/bin/csh 111101101 echo Date and time is: date echo 1111 011 012 = 7558 echo "Your username is:" ‘whoami‘ echo "Your current directory is:" ‘pwd‘ chmod 755 file.sh chmod u+x file.sh chmod -R a+rX . Graham Kemp,Chalmers University of Technology Graham Kemp,Chalmers University of Technology Editing several files at once (1) sed scripts Suppose wewant to change ‘‘cie’’to‘‘cei’’inall files in the current grep href publications.html \ director y whose name ends with ‘‘.tex’’. |sed ’s/[ˆ"]*"//’ \ |sed ’s/".*//’ #!/bin/csh Instead of giving a single editing command on the command line,wecan ls *.tex | sed ’s/.*/sed s\/cie\/cei\/g & > &tmp/’ > s1 create a script file containing a sequence of editing commands.
    [Show full text]
  • Shell Script & Advance Features of Shell Programming
    Kirti Kaushik et al, International Journal of Computer Science and Mobile Computing, Vol.4 Issue.4, April- 2015, pg. 458-462 Available Online at www.ijcsmc.com International Journal of Computer Science and Mobile Computing A Monthly Journal of Computer Science and Information Technology ISSN 2320–088X IJCSMC, Vol. 4, Issue. 4, April 2015, pg.458 – 462 RESEARCH ARTICLE Shell Script & Advance Features of Shell Programming Kirti Kaushik* Roll No.15903, CS, Department of Computer science, Dronacharya College of Engineering, Gurgaon-123506, India Email: [email protected] Jyoti Yadav Roll No. 15040, CS, Department of Applied Computer science, Dronacharya College of Engineering, Gurgaon-123506, India Email: [email protected] Kriti Bhatia Roll No. 15048, CS, Department of Applied Computer science, Dronacharya College of Engineering, Gurgaon-123506, India Email: [email protected] Abstract-- In this research paper, the idea of shell scripting and writing computer programs is examined and different parts of shell programming are likewise contemplated. A shell script is a PC system intended to be controlled by the UNIX shell which is a charge line translator. The different tongues of shell scripts are thought to be scripting dialects. Regular operations performed by shell scripts incorporate document control, program execution, and printing content. A shell script can give an advantageous variety ofa framework order where unique environment settings, charge alternatives, or post-transforming apply naturally, yet in a manner that permits the new script to still go about as a completely typical UNIX summon. The real ideas like Programming in the Borne and C-shell, in which it would be clarified that how shell programming could be possible in Borne and C-shell.
    [Show full text]
  • Examining the Hamilton C Shell
    EXAMINING ROO M Examining the Hamilton C Shell Unix power for OS/2 Scott Richman tarting OS/2 for the first time was, file system), long filenames, and threads. in the background and the server will for me, like unlocking a Ferarri, Additionally, the Shell supports large be kept busy. sitting behind its wheel and find­ command lines and pipes (up to 64K) ing a Yugo's dash. What a disap­ and includes faster and more powerful Supporting Procedures pointment. Sure, the engine and utilities than those supplied with OS/2. Script programmers can create C Shell suspensionS were first rate, but the con­ This is more than Unix - this is a pow­ procedures, which are more like func­ trols were minimal, the clutch was stiff, erful requirement for development un­ tions: They accept a parameter list and and the pedals were nonresponsive! der OS/2. The ability to execute C shells return a value. These procedures are OS/2 comes with great stuff, but CMD simultaneously in different Presenta­ compiled into C Shell memory and are .EXE, the default command-line pro­ tion Manager (PM) text windows con­ then executed as new shell commands. cessor, is poor compared to the pow­ verts your PC into a flexible workstation. Procedures can greatly extend the erfuloperating system beneath. CMD.EXE The Hamilton C Shell comes with power and flexibility of your environ­ appears to be a port of the MS-DOS many programs and shell scripts. To ment. COMMAND.COM and lacks the major install the Shell, you simply copy the As an example, consider ZCW.CSH features of a serious front end.
    [Show full text]
  • Bash Guide for Beginners
    Bash Guide for Beginners Machtelt Garrels Garrels BVBA <tille wants no spam _at_ garrels dot be> Version 1.11 Last updated 20081227 Edition Bash Guide for Beginners Table of Contents Introduction.........................................................................................................................................................1 1. Why this guide?...................................................................................................................................1 2. Who should read this book?.................................................................................................................1 3. New versions, translations and availability.........................................................................................2 4. Revision History..................................................................................................................................2 5. Contributions.......................................................................................................................................3 6. Feedback..............................................................................................................................................3 7. Copyright information.........................................................................................................................3 8. What do you need?...............................................................................................................................4 9. Conventions used in this
    [Show full text]
  • Unix and Linux System Administration and Shell Programming
    Unix and Linux System Administration and Shell Programming Unix and Linux System Administration and Shell Programming version 56 of August 12, 2014 Copyright © 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011, 2012, 2013, 2014 Milo This book includes material from the http://www.osdata.com/ website and the text book on computer programming. Distributed on the honor system. Print and read free for personal, non-profit, and/or educational purposes. If you like the book, you are encouraged to send a donation (U.S dollars) to Milo, PO Box 5237, Balboa Island, California, USA 92662. This is a work in progress. For the most up to date version, visit the website http://www.osdata.com/ and http://www.osdata.com/programming/shell/unixbook.pdf — Please add links from your website or Facebook page. Professors and Teachers: Feel free to take a copy of this PDF and make it available to your class (possibly through your academic website). This way everyone in your class will have the same copy (with the same page numbers) despite my continual updates. Please try to avoid posting it to the public internet (to avoid old copies confusing things) and take it down when the class ends. You can post the same or a newer version for each succeeding class. Please remove old copies after the class ends to prevent confusing the search engines. You can contact me with a specific version number and class end date and I will put it on my website. version 56 page 1 Unix and Linux System Administration and Shell Programming Unix and Linux Administration and Shell Programming chapter 0 This book looks at Unix (and Linux) shell programming and system administration.
    [Show full text]
  • Introduction to Shell Programming Using Bash Part I
    Introduction to shell programming using bash Part I Deniz Savas and Michael Griffiths 2005-2011 Corporate Information and Computing Services The University of Sheffield Email [email protected] [email protected] Presentation Outline • Introduction • Why use shell programs • Basics of shell programming • Using variables and parameters • User Input during shell script execution • Arithmetical operations on shell variables • Aliases • Debugging shell scripts • References Introduction • What is ‘shell’ ? • Why write shell programs? • Types of shell What is ‘shell’ ? • Provides an Interface to the UNIX Operating System • It is a command interpreter – Built on top of the kernel – Enables users to run services provided by the UNIX OS • In its simplest form a series of commands in a file is a shell program that saves having to retype commands to perform common tasks. • Shell provides a secure interface between the user and the ‘kernel’ of the operating system. Why write shell programs? • Run tasks customised for different systems. Variety of environment variables such as the operating system version and type can be detected within a script and necessary action taken to enable correct operation of a program. • Create the primary user interface for a variety of programming tasks. For example- to start up a package with a selection of options. • Write programs for controlling the routinely performed jobs run on a system. For example- to take backups when the system is idle. • Write job scripts for submission to a job-scheduler such as the sun- grid-engine. For example- to run your own programs in batch mode. Types of Unix shells • sh Bourne Shell (Original Shell) (Steven Bourne of AT&T) • csh C-Shell (C-like Syntax)(Bill Joy of Univ.
    [Show full text]
  • Unix Shell Programming – by Dinesh Kumar S
    1 Unix Shell Programming – by Dinesh Kumar S PDF by http://www.k2pdf.com Contents Chapters Topic Page no. Chapter 1 Introduction 3 Chapter 2 SSH Client 4 Chapter 3 Unix Shells 8 Chapter 4 Text Editors 11 Chapter 5 A Beginning to Shell Scripting 19 Chapter 6 Operators 33 Chapter 7 Variables Manipulation (Advance) 39 Chapter 8 Conditional Statements 43 Chapter 9 Looping Statements 47 Chapter 10 Control Statements 74 Chapter 11 Functions 79 2 Unix Shell Programming – by Dinesh Kumar S Chapter 1 Introduction Linux : It is an operating system based on UNIX . Kernel : It is the backbone of Linux OS, which is used to manage resources of Linux OS like memory, I/O, software, hardware management processes. User Shell Script Kernel PC h/w User writes script. Script contains instructions. Kernel interprets the instruction in machine language. As per the instruction kernel controls the PC hardware. Shell script : It’s a collection of OS commands or instructions. Advantages of Shell Script : Script is always a platform independent. Performance will be faster than programming languages. Very easy to debug. 3 Unix Shell Programming – by Dinesh Kumar S Chapter 2 SSH Client Secure Shell (or) SSH is a network protocol that is used to exchange or share information between two different networks. This is used on Linux & UNIX systems to access SHELL accounts. All the information exchanged/transmitted between networks is encrypted . It uses public key cryptography to authenticate remote computer user. Free Serial, Telnet, and SSH client Putty Tera Term Putty : It is a terminal emulator application which acts as client for SSH, Telnet, rLogin.
    [Show full text]
  • Curriculum Vitae of Nicole Ashley Hamilton
    Nicole Hamilton Computer Science and Engineering University of Michigan 2649 Beyster 2260 Hayward Street Ann Arbor, MI 48109-2121 [email protected] https://web.eecs.umich.edu/~nham/ Summary Lecturer in computer science and engineering at University of Michigan. Previously, lecturer in electrical engineering at University of Washington Bothell. Founder of Hamilton Laboratories and author of Hamilton C shell, a software tools package for developers on Windows. Wrote the query language and ranker for the first release of Microsoft’s Bing search engine. Expertise in digital design, Verilog, C, C++, embedded systems, processors, device drivers, compilers, circuits, transistors, search engines, OS concepts, algorithms, heuristics, Linux, program management, intellectual property, licensing. Education MBA valedictorian, High Honors, Boston University, May 1987. BS and MS, Electrical Engineering, Stanford University, June 1973. Experience Sep 2017 to Present Lecturer III, Computer Science and Engineering University of Michigan, Ann Arbor Instructor for EECS 280, C++ and Object-Oriented Programming, and EECS 398, System Design in C++, a course I created where students work in teams of five or six to build a whole search engine from scratch. Also serve on our program committee and as an undergraduate advisor. Jun 2013 to Jun 2017 Lecturer, Electrical Engineering University of Washington Bothell Instructor for BEE 271, Digital Design with Verilog, BEE/CSS 371 Business of Technology, a course on entrepreneurship, and the labs for BEE 233 Circuits, BEE 332 Transistors and BEE 425 Microprocessors. Adviser to numerous teams on their senior Capstone projects. Past teams have built a diagnostic tool for large trucks (PACCAR), a pulse width modulated motor controller using a PIC 18F4550, a DSP for an ECG using a Zynq-7000 (both Phillips) and an SDRAM controller in Verilog for the open source mips32r1 soft processor (IEEE Nexus).
    [Show full text]
  • An Introduction to the C Shell
    -- -- An Introduction to the C shell William Joy (revised for 4.3BSD by Mark Seiden) Computer Science Division Department of Electrical Engineering and Computer Science University of California, Berkeley Berkeley, California 94720 ABSTRACT Csh is a newcommand language interpreter for UNIX†systems. It incorporates good features of other shells and a history mechanism similar to the redo of INTERLISP. While incorporating manyfeatures of other shells which makewriting shell programs (shell scripts) easier,most of the features unique to csh are designed more for the interac- tive UNIX user. UNIX users who have read a general introduction to the system will find a valuable basic explanation of the shell here. Simple terminal interaction with csh is possible after reading just the first section of this document. The second section describes the shell’s capabilities which you can explore after you have begun to become acquainted with the shell. Later sections introduce features which are useful, but not necessary for all users of the shell. Additional information includes an appendix listing special characters of the shell and a glossary of terms and commands introduced in this manual. Introduction A shell is a command language interpreter. Csh is the name of one particular command interpreter on UNIX.The primary purpose of csh is to translate command lines typed at a terminal into system actions, such as invocation of other programs. Csh is a user program just likeany you might write. Hopefully, csh will be a very useful program for you in interacting with the UNIX system. In addition to this document, you will want to refer to a copyofthe UNIX User Reference Manual.
    [Show full text]
  • Chapter 5. Writing Your Own Shell
    Chapter 5. Writing Your Own Shell You really understand something until you program it. ­­GRR Introduction Last chapter covered how to use a shell program using UNIX commands. The shell is a program that interacts with the user through a terminal or takes the input from a file and executes a sequence of commands that are passed to the Operating System. In this chapter you are going to learn how to write your own shell program. Shell Programs A shell program is an application that allows interacting with the computer. In a shell the user can run programs and also redirect the input to come from a file and output to come from a file. Shells also provide programming constructions such as if, for, while, functions, variables etc. Additionally, shell programs offer features such as line editing, history, file completion, wildcards, environment variable expansion, and programing constructions. Here is a list of the most popular shell programs in UNIX: sh Shell Program. The original shell program in UNIX. csh C Shell. An improved version of sh. tcsh A version of Csh that has line editing. ksh Korn Shell. The father of all advanced shells. bash The GNU shell. Takes the best of all shell programs. It is currently the most common shell program. In addition to command­line shells, there are also Graphical Shells such as the Windows Desktop, MacOS Finder, or Linux Gnome and KDE that simplify theDraft use of computers for most of the users. However, these graphical shells are not substitute to command line shells for power users who want to execute complex sequences of commands repeatedly or with parameters not available in the friendly, but limited graphical dialogs and controls.
    [Show full text]
  • Dcap106 Operating Syste
    1 ** 23# Edited by: Dr. Avinash Bhagat www.lpude.in DIRECTORATE OF DISTANCE EDUCATION OPERATING SYSTEM TOOLS Edited By Dr. Avinash Bhagat Printed by EXCEL BOOKS PRIVATE LIMITED A-45, Naraina, Phase-I, New Delhi-110028 for Lovely Professional University Phagwara SYLLABUS Operating System Tools Objectives: To enable the student to understand technicalities of Linux including installation, troubleshooting, shell programming, file system, managing servers and internet communication. Sr. No. Topics 1. Installing Linux: Preparing for the installation, The installation, Root account configuration. 2. Red Hat Linux 9 Basics: Moving around the desktop, Using applications, The file system, hierarchy, Navigating in the file system, Managing Hardware, Configuring the desktop, Managing processes, Managing Users. 3. Connecting to the Internet: Connecting to the Internet, Managing Multiple ISPs and connections, Software and configuration. 4. Installing Software: RPM, its benefits, The RPM command line tool. 5. Everyday Applications: Office applications, Internet applications, Personal information management. 6. Everyday Applications: Multimedia applications, System applications. 7. The Shell: The Shell as a command line interface, types of shell, Built-in programs and external programs. 8. The Shell: Common Shell commands , Special keys and shortcuts, Command line syntax. 9. The File System: The File System, anatomy of a file, File Search Utilities, locate command, find command, GNOME, Navigating file system . 10. Servers: Introduction to DNS, FTP,
    [Show full text]