• Complain

Terry Sanchez-Clark - UNIX Shell Scripting Interview Questions, Answers, and Explanations: UNIX Shell Certification Review

Here you can read online Terry Sanchez-Clark - UNIX Shell Scripting Interview Questions, Answers, and Explanations: UNIX Shell Certification Review full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2007, publisher: Equity Press, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Terry Sanchez-Clark UNIX Shell Scripting Interview Questions, Answers, and Explanations: UNIX Shell Certification Review
  • Book:
    UNIX Shell Scripting Interview Questions, Answers, and Explanations: UNIX Shell Certification Review
  • Author:
  • Publisher:
    Equity Press
  • Genre:
  • Year:
    2007
  • Rating:
    4 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 80
    • 1
    • 2
    • 3
    • 4
    • 5

UNIX Shell Scripting Interview Questions, Answers, and Explanations: UNIX Shell Certification Review: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "UNIX Shell Scripting Interview Questions, Answers, and Explanations: UNIX Shell Certification Review" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Terry Sanchez-Clark: author's other books


Who wrote UNIX Shell Scripting Interview Questions, Answers, and Explanations: UNIX Shell Certification Review? Find out the surname, the name of the author of the book and a list of all author's works by series.

UNIX Shell Scripting Interview Questions, Answers, and Explanations: UNIX Shell Certification Review — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "UNIX Shell Scripting Interview Questions, Answers, and Explanations: UNIX Shell Certification Review" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make

UNIX ShellScripting InterviewQuestions: UNIX Shell ScriptingQuestions, Answers and Explanations by TerrySanchez-Clark UNIX Shell Scripting Interview Questions andAnswers 978-1-4657-4397-8 Smashwords Edition by Terry Sanchez-Clark edited by Emilee Newman Bowles Copyright 2007 Equity Press anditcookbook.com all rights reserved. No part of this publication maybe reproduced, stored in a retrieval system, or transmitted in anyform or by any means (electronic, mechanical, photocopying,recording or otherwise) without either the prior written permissionof the publisher or a license permitting restricted copying in theUnited States or abroad. The scanning, uploading and distribution ofthis book via the internet or via any other means with thepermission of the publisher is illegal and punishable by law.Please purchase only authorized electronic editions, and do notparticipate in or encourage piracy of copyrighted materials. The programs in this book have been includedfor instructional value only. They have beentested with care but are not guaranteed for anyparticular purpose. The publisher does not offer any warrantiesor representations not does it accept anyliabilities with respect to the programs.

Trademarks: All trademarks are the property of theirrespective owners. Equity Press is not associated with any productor vendor mentioned in this book. www.itcookbook.com Table of Contents Introduction UNIX shell, also called "the command line,"provides the traditional user interface for the UNIX operatingsystem. Users direct the operation of the computer by enteringcommand input as text for a shell to execute. Within the MicrosoftWindows suite of operating systems the analogous program iscommand.com or cmd.exe for Windows NT-based operating systems. In the most generic sense of the term, shellmeans any program that users use to type commands.

Since in theUNIX operating system users can select which shell they want to use(which program should execute when they login), many differentshells have been developed. It is called a "shell" because it hidesthe details of the underlying operating system behind the shell'sinterface (contrast "kernel" which refers to the lowest-level orinner-most component of an operating system). Similarly,graphical user interfaces for UNIX, such as GNOME and KDE, aresometimes called visual shells or graphical shells. By itself, theterm shell is usually associated with the command line. In UNIX,any program can be the user's shell. Users who want to use adifferent syntax for typing commands can specify a differentprogram as their shell.

The term shell also refers to a particularprogram, namely the Bourne shell, sh. The Bourne shell was theshell used in early versions of UNIX and became a de factostandard; every Unix-like system has the equivalent of the Bourneshell. The Bourne shell program is located in the UNIX filehierarchy at /bin/sh. On some systems, such as BSD, /bin/sh is aBourne shell or equivalent, but on other systems such as Linux,/bin/sh is likely to be a link to a compatible, but morefeature-rich shell, such as Bash. POSIX specifies the standardshell as a strict subset of the Korn shell. The UNIX shell was unusual when firstcreated, since it is both an interactive command language and thelanguage used to script the system; it is a scripting programminglanguage.

Many shells created for other operating systems sinceoffer rough equivalents to UNIX shell functionality. On systems using a windowing system, someusers may never use the shell directly, though on UNIX systems, theshell is still the implementation language of system startupscripts, including the program that starts the windowing system,the program that dials into the Internet, and many other essentialfunctions. On MS-DOS, OS/2, and Windows, equivalents toUNIX system scripts are called batch files, and have either a".bat" or ".cmd" extension. A newer CLI, code named Monad and to bereleased as the Windows PowerShell, will replace the existing NTcommand line, cmd.exe; it has many features derived from UNIXshells, though it uses a somewhat different syntax. Many regular users of a UNIX system stillfind a modern command line shell much more convenient for manytasks than any GUI application. Due to the recent movement in favor of opensource, most UNIX shells have at least one version that is opensource.

BASIC QUESTIONSAND ANSWERS: Questions most likely to be asked bybeginners Questio n 01:Shell Script What is shell script anyway? A: A shell script, in its most basic form, is simplya collection of operating system commands put into a text file inthe order they are needed for execution. Using any of the shellsmentioned so far, a text file containing the commands listed inexample basic shell script would work every time the script wasexecuted. Example basic shell script: #!/bin/sh rm -f /tmp/listing.tmp> /dev/null2>&1 touch /tmp/listing.tmp ls -l [a-z]*.doc | sort>/tmp/listing.tmp lpr -Ppostscript_1 /tmp/listing.tmp rm -f /tmp/listing.tmp Of course, not all scripts are this simplebut it does show that ordinary UNIX commands can be used withoutany extra, fancy scripting constructs. If this script was executedany number of times the result would be the same, a long listing ofall the files starting with lower case letters and ending with adoc extension from the current directory printed out on your localPostScript printer. Lets start to look at this in detail startingat the beginning. In the Beginning: The first line of any script should alwayslook a bit like the top line in the example basic shell script; theonly difference would be the path leading to the shell executablefile, in this case the /bin/sh part.

By default, the UNIX systemwill attempt to execute an ASCII text file if the files name is supplied as the firstargument on the command line. UNIX will attempt to execute the filein the current shell and try to process the included commandstrings within the file using the syntax rules of the currentshell. So, if you are using the Bourne Shell as your defaultenvironment and the ASCII file contains a list of UNIX commandstructures formatted how the Bourne Shell likes them to beformatted, all will work fine. However, if you try and execute a CShell file with a different syntax structure, the Operating Systemwill complain about unrecognized commands and syntax errors. Thereason is no one told the Operating System that it was a C Shellfile, so it processed it as a Bourne Shell. The correct way toindicate this to the Operating System is to pass the script name tothe shell executable as an argument thus: user@system$ /bin/csh my_script arg_1arg_2 However, it didn't take long for someone tonotice that this was extra typing that could well be done away withand hence the short hand first line comment was born.

Basically, all comments in shell scriptsstart with a hash sign (#). However, for the first line only, UNIXreads past the hash to see what's next. If it finds an exclamationpoint (!), or Bang! as it's known, then what follows is taken asthe path to the shell executable binary program. Not only can that,but all the command line arguments that the shell executable allowsalso be stacked up on this line. With this feature it doesn'tmatter what flavor of shell your environment is, you can execute ascript in any other flavor of shell, as if it was a real UNIXcommand. Lets look at the Bourne Shell syntax rules more closely.It would be helpful at this point to print out the sh man pagesfrom your system so that you can compare them with what I havehere.

Question 02 :Invoking Shell Scripts How do you invoke shell scripts? A: There are two ways to invoke a shell scriptfile. 1. Direct Interpretation: In direct interpretation, the command cshfilename [arg ...] invokes the program csh to interpret the scriptcontained in the file filename. 2. Indirect Interpretation: In indirect interpretation, we must insert asthe first line of the file: #! /bin/csh or #! /bin/csh -f There are situations in which this is notnecessary, but it won't hurt to have it and the file must be madeexecutable using chmod. Then it can be invoked in the same way asany other command, i.e., by typing the script file name on thecommand line.

Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «UNIX Shell Scripting Interview Questions, Answers, and Explanations: UNIX Shell Certification Review»

Look at similar books to UNIX Shell Scripting Interview Questions, Answers, and Explanations: UNIX Shell Certification Review. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «UNIX Shell Scripting Interview Questions, Answers, and Explanations: UNIX Shell Certification Review»

Discussion, reviews of the book UNIX Shell Scripting Interview Questions, Answers, and Explanations: UNIX Shell Certification Review and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.