6. Machine-Specific Scripting

Total Page:16

File Type:pdf, Size:1020Kb

6. Machine-Specific Scripting ,ch06.2677 Page 73 Thursday, April 8, 2004 11:56 AM Chapter 6 6 6. Machine-Specific Scripting So far, we have demonstrated the use of scripts that will run unattended on any number of workstations, quietly managing, reporting, and configuring as required by the administrator. These scripts even maintain themselves, noting when they become obsolete and replacing themselves when changes on a remote server sug- gest that they should do so. While there are many circumstances in which this functionality is more than sufficient, there is one major limitation: none of the techniques or scripts we have described is able to differentiate its behavior depending on the machine on which it is being run. This may not pose a prob- lem if the tasks being carried out are all routine and generally applicable, but it does impose severe restrictions if the purpose of scripting is to automate reconfig- uration of a machine or if you require certain tasks to be carried out only on spe- cific machines. In this chapter, we explain how to enhance the techniques already described by writing scripts whose actions are partially determined by the specific workstation on which they are running. First, we demonstrate the extraction and comparison of an identifier that can be found trivially within the registry. We then describe types of situations in which such an identifier falls short; the bulk of the chapter is devoted to describing various ways of extracting information that unambiguously and uniquely identifies a workstation. It is this latter type that we use exclusively in our scripts, for reasons which should soon become self-evident. Extracting the Machine Identifier Every Windows NT workstation has a name, an identity that is assigned to it when the operating system is installed. This name must be unique on a local area net- work because it is used for Windows networking; it normally (but not always) has 73 ,ch06.2677 Page 74 Thursday, April 8, 2004 11:56 AM 74 Chapter 6: Machine-Specific Scripting the same value as the hostname if IP networking is installed.* As far as we are con- cerned at the moment, the useful thing about this name is that it is incredibly easy to extract from a workstation. This means that it can provide us with a simple way of specifying script behavior that varies depending upon the individual worksta- tion on which it is being run. There are several methods available for retrieving the machine name from a work- station. Four obvious ones spring to mind: • Get it through the Network Control Panel. • Retrieve it from the registry. • Use network command-line utilities. • Read an environment variable. A brief description of each of these methods follows. From the Network Control Panel If you are sitting at a workstation, the quickest way to obtain the computer name is probably through the Network Control Panel. Simply open the panel (Start ➝ Settings ➝ Control Panel ➝ Network) and you will be presented with a dialog looking very much like the one in Figure 6-1. The computer name is presented clearly and unambiguously. Clearly, although this extraction method is trivial for someone sitting at a worksta- tion, it would not be of much use to a script. For this we have to turn to one of the other options. From the Registry It should come as no surprise to find that a workstation’s computer name is stored in the registry. A few minutes browsing with Regedt32 would reveal that the infor- mation is stored in the HKEY_LOCAL_MACHINE hive under the string value HKLM\ SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName. The fol- lowing short Perl scriptlet, computername.pl extracts the computer name of a workstation from the registry and prints it to standard output: #computername.pl use Win32::Registry; $key = 'SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName'; * The computer name, hostname, and significance for Windows networking (NetBIOS) will be discussed in much more detail in the next chapter. ,ch06.2677 Page 75 Thursday, April 8, 2004 11:56 AM Extracting the Machine Identifier 75 Figure 6-1. Network Control Panel Win32::Registry::RegOpenKeyEx (&HKEY_LOCAL_MACHINE,$key,NULL,&KEY_ALL_ACCESS,$RegHandle); Win32::Registry::RegQueryValueEx ($RegHandle, 'ComputerName', NULL, $type, $answer); Win32::Registry::RegCloseKey($RegHandle); print "The name of this NT workstation is $answer"; Running this scriptlet from the command line on a workstation called albatross will produce the following results: C:>computername.pl The name of this NT workstation is ALBATROSS Using net.exe Another straightforward way of finding out the name of a computer is to use a net command. Here, we will concentrate on one incantation of the command, net config workstation, which displays information about the workstation service. Typing this command at the command line produces a list of parameters, sepa- rated into four logical groups, which can loosely be described as concerning: • Identity • Networking hardware • Domain information • Communication time-outs ,ch06.2677 Page 76 Thursday, April 8, 2004 11:56 AM 76 Chapter 6: Machine-Specific Scripting The section we are interested in is the first one. The information displayed here looks very much like this: C:\>net config workstation Computer name \\ALBATROSS User name home As you can see, the computer name takes pride of place. The extraction of just the computer name from this output can be accomplished with the following frag- ment of Perl: @output = `net config workstation`; $output[0] =~ s/.*\\\\(.*)/$1/; print "The computer name is: $output[0]"; The code may look a little obfuscated thanks to the regular expression, but it is actually incredibly simple. The first line calls net config workstation and stores the output in an array. A regular expression then replaces the first line of the array with the value of the computer name (“find any number of any characters, fol- lowed by two backslashes, followed by any number of any more characters; replace everything with the bit after the backslashes”). Finally we prove the point by printing the computer name to standard output. From the Environment Short of using the GUI-based Network Control Panel, by far the simplest method for extracting the computer name from a workstation is to read the environment table. In common with virtually all operating systems in the world, Windows NT provides a set of so-called environment variables that store information about the machine and current user. These variables are listed if the set command is typed at the command prompt without any parameters. If you type set and read the list of variables, you will find that one of them is called computername; its value, unsurprisingly, is set to the name of the workstation. Extracting the value from an environment variable is totally trivial: on the Windows NT command line, any word sandwiched between two % symbols is treated as an environment variable and automatically “expanded” to the value of that variable. Therefore, on a work- station called albatross, the command: C:>echo This computer is called %computername% will produce the following output: This computer is called ALBATROSS Perl provides the special variable %ENV to read environment variables. The follow- ing scriplet reads the computer name from the environment and prints it to stan- dard output: ,ch06.2677 Page 77 Thursday, April 8, 2004 11:56 AM Extracting the Machine Identifier 77 #computername.pl print "The name of this NT workstation is $ENV{computername}"; We leave it to your imagination to work out what the output of this scriptlet may look like! Clearly this is a much neater, simpler way of retrieving that computer name than using the registry or parsing the output of a command-line network utility; it would be very difficult to justify using any other method unless the circumstances were rather exceptional. Given that it is so easy for a script to identify the name of the workstation on which it is running, it seems rather perverse to suggest—as we are just about to— that this is actually a rather unsatisfactory identifier. Although it and the extraction techniques discussed earlier are perfectly adequate for many maintenance and configuration tasks that require a script to behave differentially depending on the workstation on which it is running, there are certain situations in which reliance on computer name is not at all satisfactory. The reason for this is that while com- puter names are usually unique on a LAN, there is no guarantee that they are unique. In fact, in some situations, you can be extremely confident that they will not be unique, for example, if a set of workstations are disk-imaged clones or if the operating system has been installed automatically with a default set of parame- ters. Furthermore, there may be situations in which a workstation regularly changes its name or location, perhaps depending on who is using it. In any of these cases, a script that really needs to know on which workstation it is running will have to find a more robust method of identifying machines. Ideally, this method should be completely impervious to any amount of configuration and tweaking. Thankfully, every computer that contains an Ethernet card does have exactly what we need—a unique identifier encoded in hardware—which goes by the name of MAC address. Furthermore, virtually every operating system that supports network- ing provides a means of extracting this information relatively easily. Or at least for those that don’t, someone (the OS vendors themselves in the case of NT) pro- vides utilities to do it for you. The rest of this chapter is dedicated to describing various ways of retrieving a workstation’s MAC address; in the next chapter, we give an extended example of putting it to use by writing a configuration script that can totally change a workstation’s identity.
Recommended publications
  • Pingdirectory Administration Guide Version
    Release 7.3.0.3 Server Administration Guide PingDirectory | Contents | ii Contents PingDirectory™ Product Documentation................................................ 20 Overview of the Server............................................................................. 20 Server Features.................................................................................................................................20 Administration Framework.................................................................................................................21 Server Tools Location....................................................................................................................... 22 Preparing Your Environment....................................................................22 Before You Begin.............................................................................................................................. 22 System requirements..............................................................................................................22 Installing Java......................................................................................................................... 23 Preparing the Operating System (Linux).......................................................................................... 24 Configuring the File Descriptor Limits.................................................................................... 24 File System Tuning.................................................................................................................25
    [Show full text]
  • Docker Windows Task Scheduler
    Docker Windows Task Scheduler Genealogical Scarface glissading, his karyotype outgone inflicts overflowingly. Rudolph is accessorial and suckers languorously as sociologistic Engelbart bridled sonorously and systematises sigmoidally. Which Cecil merchandises so unbelievably that Cole comedowns her suavity? Simple task runner that runs pending tasks in Redis when Docker container. With Docker Content Trust, see will soon. Windows Tip Run applications in extra background using Task. Cronicle is a multi-server task scheduler and runner with a web based front-end UI It handles both scheduled repeating and on-demand jobs targeting any. Django project that you would only fetch of windows task directory and how we may seem. Docker schedulers and docker compose utility program by learning service on a scheduled time, operators and manage your already interact with. You get a byte array elements followed by the target system privileges, manage such data that? Machine learning service Creatio Academy. JSON list containing all my the jobs. As you note have noticed, development, thank deity for this magazine article. Docker-crontab A docker job scheduler aka crontab for. Careful with your terminology. Sometimes you and docker schedulers for task failed job gets silently redirected to get our task. Here you do want to docker swarm, task scheduler or scheduled background tasks in that. Url into this script in one easy to this was already existing cluster created, it retry a little effort. Works pretty stark deviation from your code is followed by searching for a process so how to be executed automatically set. Now docker for windows service container in most amateur players play to pass as.
    [Show full text]
  • Catalyst 9500 Switches)
    System Management Configuration Guide, Cisco IOS XE Gibraltar 16.12.x (Catalyst 9500 Switches) First Published: 2019-07-31 Americas Headquarters Cisco Systems, Inc. 170 West Tasman Drive San Jose, CA 95134-1706 USA http://www.cisco.com Tel: 408 526-4000 800 553-NETS (6387) Fax: 408 527-0883 THE SPECIFICATIONS AND INFORMATION REGARDING THE PRODUCTS IN THIS MANUAL ARE SUBJECT TO CHANGE WITHOUT NOTICE. ALL STATEMENTS, INFORMATION, AND RECOMMENDATIONS IN THIS MANUAL ARE BELIEVED TO BE ACCURATE BUT ARE PRESENTED WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. USERS MUST TAKE FULL RESPONSIBILITY FOR THEIR APPLICATION OF ANY PRODUCTS. THE SOFTWARE LICENSE AND LIMITED WARRANTY FOR THE ACCOMPANYING PRODUCT ARE SET FORTH IN THE INFORMATION PACKET THAT SHIPPED WITH THE PRODUCT AND ARE INCORPORATED HEREIN BY THIS REFERENCE. IF YOU ARE UNABLE TO LOCATE THE SOFTWARE LICENSE OR LIMITED WARRANTY, CONTACT YOUR CISCO REPRESENTATIVE FOR A COPY. The Cisco implementation of TCP header compression is an adaptation of a program developed by the University of California, Berkeley (UCB) as part of UCB's public domain version of the UNIX operating system. All rights reserved. Copyright © 1981, Regents of the University of California. NOTWITHSTANDING ANY OTHER WARRANTY HEREIN, ALL DOCUMENT FILES AND SOFTWARE OF THESE SUPPLIERS ARE PROVIDED “AS IS" WITH ALL FAULTS. CISCO AND THE ABOVE-NAMED SUPPLIERS DISCLAIM ALL WARRANTIES, EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, THOSE OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OR ARISING FROM A COURSE OF DEALING, USAGE, OR TRADE PRACTICE. IN NO EVENT SHALL CISCO OR ITS SUPPLIERS BE LIABLE FOR ANY INDIRECT, SPECIAL, CONSEQUENTIAL, OR INCIDENTAL DAMAGES, INCLUDING, WITHOUT LIMITATION, LOST PROFITS OR LOSS OR DAMAGE TO DATA ARISING OUT OF THE USE OR INABILITY TO USE THIS MANUAL, EVEN IF CISCO OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
    [Show full text]
  • System Analysis and Tuning Guide System Analysis and Tuning Guide SUSE Linux Enterprise Server 15 SP1
    SUSE Linux Enterprise Server 15 SP1 System Analysis and Tuning Guide System Analysis and Tuning Guide SUSE Linux Enterprise Server 15 SP1 An administrator's guide for problem detection, resolution and optimization. Find how to inspect and optimize your system by means of monitoring tools and how to eciently manage resources. Also contains an overview of common problems and solutions and of additional help and documentation resources. Publication Date: September 24, 2021 SUSE LLC 1800 South Novell Place Provo, UT 84606 USA https://documentation.suse.com Copyright © 2006– 2021 SUSE LLC and contributors. All rights reserved. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or (at your option) version 1.3; with the Invariant Section being this copyright notice and license. A copy of the license version 1.2 is included in the section entitled “GNU Free Documentation License”. For SUSE trademarks, see https://www.suse.com/company/legal/ . All other third-party trademarks are the property of their respective owners. Trademark symbols (®, ™ etc.) denote trademarks of SUSE and its aliates. Asterisks (*) denote third-party trademarks. All information found in this book has been compiled with utmost attention to detail. However, this does not guarantee complete accuracy. Neither SUSE LLC, its aliates, the authors nor the translators shall be held liable for possible errors or the consequences thereof. Contents About This Guide xii 1 Available Documentation xiii
    [Show full text]
  • Managing User Accounts and User Environments in Oracle® Solaris 11.3
    Managing User Accounts and User ® Environments in Oracle Solaris 11.3 Part No: E54800 March 2017 Managing User Accounts and User Environments in Oracle Solaris 11.3 Part No: E54800 Copyright © 1998, 2017, Oracle and/or its affiliates. All rights reserved. This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited. The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing. If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, then the following notice is applicable: U.S. GOVERNMENT END USERS: Oracle programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, delivered to U.S. Government end users are "commercial computer software" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, use, duplication, disclosure, modification, and adaptation of the programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, shall be subject to license terms and license restrictions applicable to the programs.
    [Show full text]
  • Rebooting a Router
    Rebooting a Router This chapter describes the basic procedure a router follows when it reboots, how to alter the procedure, and how to use the ROM Monitor. For a complete description of the booting commands mentioned in this chapter, refer to the “Booting Commands” chapter in the Cisco IOS Configuration Fundamentals Command Reference. To locate documentation of other commands that appear in this chapter, use the command reference master index or search online. Rebooting a Router Task List You can perform the tasks related to rebooting discussed in the following sections: • Displaying Booting Information • Rebooting Procedures • Modifying the Configuration Register Boot Field • Setting Environment Variables • Scheduling a Reload of the System Image • Entering ROM Monitor Mode • Manually Loading a System Image from ROM Monitor • Configuring High System Availability on the Cisco 7500 Series Cisco IOS Configuration Fundamentals Configuration Guide FC-207 Rebooting a Router Displaying Booting Information Displaying Booting Information Use the following commands in EXEC mode to display information about system software, system image files, and configuration files: Command Purpose show bootvar Lists the contents of the BOOT environment variable, the name of the configuration file pointed to by the CONFIG_FILE environment variable, and the contents of the BOOTLDR environment variable. more nvram:startup-config Lists the startup configuration information. On all platforms except the Class A Flash file systems, the startup configuration is usually in NVRAM. On Class A Flash file systems, the CONFIG_FILE environment variable points to the startup configuration, defaulting to NVRAM. show version Lists the system software release version, system image name, configuration register setting, and other information.
    [Show full text]
  • UEFI Shell Specification
    UEFI Shell Specification January 26, 2016 Revision 2.2 The material contained herein is not a license, either expressly or impliedly, to any intellectual property owned or controlled by any of the authors or developers of this material or to any contribution thereto. The material contained herein is provided on an "AS IS" basis and, to the maximum extent permitted by applicable law, this information is provided AS IS AND WITH ALL FAULTS, and the authors and developers of this material hereby disclaim all other warranties and conditions, either express, implied or statutory, including, but not limited to, any (if any) implied warranties, duties or conditions of merchantability, of fitness for a particular purpose, of accuracy or completeness of responses, of results, of workmanlike effort, of lack of viruses and of lack of negligence, all with regard to this material and any contribution thereto. Designers must not rely on the absence or characteristics of any features or instructions marked "reserved" or "undefined." The Unified EFI Forum, Inc. reserves any features or instructions so marked for future definition and shall have no responsibility whatsoever for conflicts or incompatibilities arising from future changes to them. ALSO, THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR NON-INFRINGEMENT WITH REGARD TO THE SPECIFICATION AND ANY CONTRIBUTION THERETO. IN NO EVENT WILL ANY AUTHOR OR DEVELOPER OF THIS MATERIAL OR ANY CONTRIBUTION THERETO BE LIABLE TO ANY OTHER PARTY FOR THE COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST PROFITS, LOSS OF USE, LOSS OF DATA, OR ANY INCIDENTAL, CONSEQUENTIAL, DIRECT, INDIRECT, OR SPECIAL DAMAGES WHETHER UNDER CONTRACT, TORT, WARRANTY, OR OTHERWISE, ARISING IN ANY WAY OUT OF THIS OR ANY OTHER AGREEMENT RELATING TO THIS DOCUMENT, WHETHER OR NOT SUCH PARTY HAD ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.
    [Show full text]
  • Package 'Uptimerobot'
    Package ‘uptimeRobot’ October 22, 2015 Type Package Version 1.0.0 Title Access the UptimeRobot Ping API Description Provide a set of wrappers to call all the endpoints of UptimeRobot API which includes various kind of ping, keep-alive and speed tests. See <https://uptimerobot.com/> for more information. Date 2015-10-21 URL https://gabrielebaldassarre.com/r/uptimerobot BugReports https://github.com/theclue/uptimeRobot/issues Depends R (>= 3.0) Imports rjson, RCurl, plyr Suggests testthat License MIT + file LICENSE NeedsCompilation no BuildKeepEmpty TRUE Author Gabriele Baldassarre [aut, cre] Maintainer Gabriele Baldassarre <[email protected]> Repository CRAN Date/Publication 2015-10-22 15:23:18 R topics documented: uptimerobot.account.details . .2 uptimerobot.contact.delete . .3 uptimerobot.contact.new . .4 uptimerobot.contacts . .5 uptimerobot.fields . .6 uptimerobot.monitor.contacts . .7 uptimerobot.monitor.delete . .8 uptimerobot.monitor.edit . .9 1 2 uptimerobot.account.details uptimerobot.monitor.logs . 11 uptimerobot.monitor.new . 12 uptimerobot.monitor.reset . 14 uptimerobot.monitor.responses . 15 uptimerobot.monitors . 16 Index 19 uptimerobot.account.details Get the account details for who is linked to the given API key Description uptimerobot.account.details returns a list or a vector with the account details connected to the given api key. Usage uptimerobot.account.details(api.key, unlist = FALSE) Arguments api.key string with a valid key for connecting to Uptimerobot API. unlist logical. Set to TRUE to unlist the
    [Show full text]
  • Unix Login Profile
    Unix login Profile A general discussion of shell processes, shell scripts, shell functions and aliases is a natural lead in for examining the characteristics of the login profile. The term “shell” is used to describe the command interpreter that a user runs to interact with the Unix operating system. When you login, a shell process is initiated for you, called your login shell. There are a number of "standard" command interpreters available on most Unix systems. On the UNF system, the default command interpreter is the Korn shell which is determined by the user’s entry in the /etc/passwd file. From within the login environment, the user can run Unix commands, which are just predefined processes, most of which are within the system directory named /usr/bin. A shell script is just a file of commands, normally executed at startup for a shell process that was spawned to run the script. The contents of this file can just be ordinary commands as would be entered at the command prompt, but all standard command interpreters also support a scripting language to provide control flow and other capabilities analogous to those of high level languages. A shell function is like a shell script in its use of commands and the scripting language, but it is maintained in the active shell, rather than in a file. The typically used definition syntax is: <function-name> () { <commands> } It is important to remember that a shell function only applies within the shell in which it is defined (not its children). Functions are usually defined within a shell script, but may also be entered directly at the command prompt.
    [Show full text]
  • ROM Monitor Commands, Page 54-2
    CHAPTER 54 ROM Monitor This appendix describes the Cisco Catalyst 4500 switch ROM monitor (also called the bootloader program). The ROM monitor firmware runs when the switch is powered up or reset. The firmware helps to initialize the hardware and boot the operating system software. Use the ROM monitor to perform certain configuration tasks, such as recovering a lost password, booting an IOS image on the on-board flash/removeable storage media/management port, and upgrading the Rommon image itself. If there is no Cisco IOS software image loaded on the switch, the ROM monitor runs the switch. This appendix contains the following sections: • Entering the ROM Monitor, page 54-1 • ROM Monitor Commands, page 54-2 • Command Descriptions, page 54-2 • Configuration Register, page 54-3 • Exiting the ROM Monitor, page 54-5 • Digital Signing, page 54-6 Note For complete syntax and usage information for the switch commands used in this chapter, refer to the Catalyst 4500 Series Switch Cisco IOS Command Reference and related publications at this location: http://www.cisco.com/en/US/products/ps6350/index.html Entering the ROM Monitor To use the ROM monitor, you must be using a terminal or PC that is connected to the switch over the console port. Refer to the installation chapter in the Cisco Catalyst 4500 Switch Hardware Installation Guide that came with the switch to connect the router to a PC or terminal.. Perform these steps to configure the switch to boot up in ROM monitor mode the next time it is rebooted. Command Task Step 1 enable Enters privileged EXEC mode.
    [Show full text]
  • Configure an Environment Variable Item
    Configure an Environment Variable Item 2 out of 44 rated this helpful - Rate this topic Applies To: Windows 8, Windows Server 2008 R2, Windows Server 2012 Environment Variable preference items allow you to create, update, replace, and delete user and system environment variables or semicolon-delimited segments of the PATH variable. Before you create an Environment Variable preference item, you should review the behavior of each type of action possible with this extension. Creating an Environment Variable item To create a new Environment Variable preference item 1. Open the Group Policy Management Console . Right-click the Group Policy object (GPO) that should contain the new preference item, and then click Edit . 2. In the console tree under Computer Configuration or User Configuration , expand the Preferences folder, and then expand the Windows Settings folder. 3. Right-click the Environment node, point to New , and select Environment Variable . 4. In the New Environment Variable Properties dialog box, select an Action for Group Policy to perform. (For more information, see "Actions" in this topic.) 5. Enter environment variable settings for Group Policy to configure or remove. (For more information, see "Environment variable settings" in this topic.) 6. Click the Common tab, configure any options, and then type your comments in the Description box. (For more information, see Configure Common Options.) 7. Click OK . The new preference item appears in the details pane. Actions This type of preference item provides a choice of four actions: Create , Replace , Update , and Delete . The behavior of the preference item varies with the action selected and whether the environment variable already exists.
    [Show full text]
  • Learning the Bash Shell, 3Rd Edition
    1 Learning the bash Shell, 3rd Edition Table of Contents 2 Preface bash Versions Summary of bash Features Intended Audience Code Examples Chapter Summary Conventions Used in This Handbook We'd Like to Hear from You Using Code Examples Safari Enabled Acknowledgments for the First Edition Acknowledgments for the Second Edition Acknowledgments for the Third Edition 1. bash Basics 3 1.1. What Is a Shell? 1.2. Scope of This Book 1.3. History of UNIX Shells 1.3.1. The Bourne Again Shell 1.3.2. Features of bash 1.4. Getting bash 1.5. Interactive Shell Use 1.5.1. Commands, Arguments, and Options 1.6. Files 1.6.1. Directories 1.6.2. Filenames, Wildcards, and Pathname Expansion 1.6.3. Brace Expansion 1.7. Input and Output 1.7.1. Standard I/O 1.7.2. I/O Redirection 1.7.3. Pipelines 1.8. Background Jobs 1.8.1. Background I/O 1.8.2. Background Jobs and Priorities 1.9. Special Characters and Quoting 1.9.1. Quoting 1.9.2. Backslash-Escaping 1.9.3. Quoting Quotation Marks 1.9.4. Continuing Lines 1.9.5. Control Keys 4 1.10. Help 2. Command-Line Editing 2.1. Enabling Command-Line Editing 2.2. The History List 2.3. emacs Editing Mode 2.3.1. Basic Commands 2.3.2. Word Commands 2.3.3. Line Commands 2.3.4. Moving Around in the History List 2.3.5. Textual Completion 2.3.6. Miscellaneous Commands 2.4. vi Editing Mode 2.4.1.
    [Show full text]