...Bash Guide for Beginners Machtelt Garrels Garrels BVBA 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? .......................................................................................................................
Words: 29161 - Pages: 117
...1. Your organization routinely uses scripts, but as some employees have left, there are scripts that contain only command lines and no one is certain of their purpose. What steps can be taken to ensure a way for others to know the purpose of a script? C. Require that script writers place comment lines inside the scripts using the # symbol to begin each command line. 2. Which of the following shells enable the use of scripts? (Choose all that apply.) A. Bash B. csh D. zsh 3. You frequently use the command ls-a and want to save time by just entering l to do the same thing. Which of the following commands enables you to set your system to view hidden files by only entering l? D. alias l= "ls -a" 4. You have written a script, but when you run it there is an error. Which of the following commands can you use to debug your script? (Choose all that apply.) B. sh -v D. sh –x 5. You have written a shell program that creates four temporary files. Which of the following commands can you use to remove these files when the script has completed its work? A. trap 6. Which of the following commands work well for menus used in a script? (Choose all that apply.) B. case 7. You are currently in the soruce directory, which is the new directory you have just created for storying and running your scripts. You want to make certain that the source directory is in your default path. Which of the following commands enable you to view the current...
Words: 356 - Pages: 2
...Title:How to script: A Bash crash course; An easy step-by-step guide to the Bash command-line shell and shell scripting Author(s):Paul Venezia Source:InfoWorld.com. (Mar. 8, 2013): Document Type:Article Copyright : COPYRIGHT 2013 InfoWorld Media Group, Inc. http://www.infoworld.com/ Full Text: Byline: Paul Venezia Few aspects of Unix system administration are more intimate than the relationship between the admin and their chosen shell. After all, the shell is the most fundamental interface to the system, the conduit for all command-line interactions. Thus, it's important to have a solid foundation in whatever shell you choose. There are many different shells available, from Ash to Zsh. They all differ in many ways, and some (such as Csh and Tcsh) vary wildly from the others. Each has its selling points. However, because Bash has become the de-facto standard shell on most Unix-like operating systems and can generally be found everywhere, it makes an excellent place to start, even if you ultimately choose a different shell for daily use. [ How to get started with MySQL | How to install Apache on Linux | Prove your expertise with the free OS in InfoWorld's Linux admin IQ test round 1 and round 2. | Track the latest trends in open source with InfoWorld's Open Sources blog and Technology: Open Source newsletter. ] This is not designed to be an exhaustive tutorial, but is structured to introduce you to shells in general and Bash in particular, touching on many...
Words: 4013 - Pages: 17
...************** (Also works with *** Capo 1 *** chords G#, D#, & A#.) ************** Verses G D e |--------3-------2-------| b |--------3-------3-------| g |------0-----2---2-------|<--- Repeat through d |----0------0-0--0-------|<--- all Verses a |----------------x-------| E |--3-------------x-------| Occasionally after the D chord there is a guitar riff but I didnt want to attempt to tab it. Chorus D A Amor, no es amor (if this aint love) G D What am I feeling (what am i doing wrong) D A Amor, no es amor (if this aint love) G A Its just an illusion that i have in my heart D A G e |----2-----0-----3---------| b |----3-----2-----3---------| g |----2-----2-----0---------| d |----0-----2-----0---------| a |----x-----0-----2---------| E |----x-----x-----3---------| ...
Words: 660 - Pages: 3
...9 9 Chapter9 Answers to Evennumbered Exercises 9 1. 2. What are two ways you can execute a shell script when you do not have execute access permission to the file containing the script? Can you execute a shell script if you do not have read access permission? You can give the name of the file containing the script as an argument to the shell (for example, sh scriptfile, where scriptfile is the name of the file containing the script). Under bash you can give the following command: $ . scriptfile Because the shell must read the commands from the file containing a shell script before it can execute the commands, you must have read permission for the file in order to execute the shell script. 3. 4. Assume that you have made the following assignment: $ person=jenny Give the output of each of the following commands: a. echo $person jenny b. echo '$person' $person c. echo "$person" jenny 5. 1 2 Chapter 9 6. Assume that the /home/jenny/grants/biblios and /home/jenny/biblios directories exist. For both (a) and (b), give Jenny’s working directory after she executes the sequence of commands given. Explain. a. $ pwd /home/jenny/grants $ CDPATH=$(pwd) $ cd $ cd biblios After executing the preceding commands, Jenny’s working directory is /home/jenny/grants/biblios. When CDPATH is set, cd searches only the directories specified by CDPATH; cd does not search the working directory unless the working directory is specified in CDPATH (by using a period). b. $ pwd /home/jenny/grants $...
Words: 737 - Pages: 3
...Enterprise Odisha Even after 62 years of independence, Odisha our beloved state is still developing. With thirty districts it is the 9th largest state in the country (155,707 Sq Km) and population wise 11th (36,706,920). It is a state which is rich with all kinds of resources right from minerals, fossil fuel and ores to rich history and culture. The land is fertile and has the capability to produce many Rabi and Kharip crops. Now if we scan the country and try to name the prosperous states, we can count them on finger tips. Among which Gujarat, Haryana, Punjab and Goa may be the front runners. Odisha may not even appear in the first 10. So what makes these states economically better than us despite the fact that we are far wealthier than the others in terms of Natural Resources, history, culture and intelligent brains? To find out let’s have a closer look at the simple strategies adopted by the prosperous states. My father always said, owning a gold brick does not make you rich. You will be rich only when you learn to make a fortune out of it. It is that simple. The prosperous states have done this. Only that in their case, the areas of their strength was their gold brick. Gujarat is strong in entrepreneurship and business sense, Goa is rich in natural landscapes and Punjab is rich with fertile agricultural land. These states have worked on their strengths to develop themselves. When I say the states have done it, I mean the contribution of both government and people...
Words: 766 - Pages: 4
...Exercises stores the complete set of positional parameters as a single string 4. a. When you are writing many shell scripts, it can get tedious to give many chmod commands. This function speeds up the process. b. $ function perms { > chmod u+x $* > } c. Put the function in your .bash_profile, .bash_login, or .profile file to make it available each time you run a log in (using bash). d. Use source to execute the file you put the function in, i.e. $ source .bash_profile 5. A shell function will do nothing unless it is explicitly called by other code A shell script is a runnable, executable process, which can call other shell scripts and/or functions. The question might be worded backwards - it is necessary to write shell functions for shell scripts when certain logical functionality is required to be performed multiple times - they operate the same way. 6. $ cat listdirs file "$@" | grep directory | sed 's/:.*//'. 9. a. #!/bin/bash plus1 () { echo $(($1 + 1)); } echo $(plus1 8) export -f plus1 ./child 14 21 b. Each Name the full file name of the command is determined by searching the directories in $PATH and remembered. c. If command is not specified, a non-interactive shell exits, unless the shell option exefail is enabled, in which case if returns failure. Returns if file cannot be executed. Exercises 1. -w option on the command line 2. Array is an order list of values position by index. Hash is an unordered list...
Words: 292 - Pages: 2
...marks. This list works when you specify a single filename. When you specify more than one file, the shell reports No such file or directory because there is not a file named the string you specified on the command line (the SPACEs are not special characters when they are enclosed within single quotation marks). 3. Sort,tsort diff, patch,diff3, sdiff, cmp, comm, uniq, expand, unexpand, cut, colrm, paste, join, head, tail, grep, look, sed,awk, sed, awk, wc, tr, fold, fmt, ptx, column, nl, pr, gettext, iconv, recode, groff, gs, TeX, lex, yacc, 4. $ function pores } * Chmod u+x $1 * } * a. When might such a function be useful? * When you are writing many shell scripts, it can get tedious to give many * chmod commands. This function speeds up the process. * b. Revise the script so that it takes one or more filenames as arguments * and adds execute permission for the user for each file argument. * $ function perms { * > chmod u+x $* * > } * c. What can you do to make the function available every time you log in? * Put the function in your .bash_profile, .bash_login, or .profile file to make * it available each time you run a log in (using bash). * d. What if, in addition to having the function available on subsequent * login sessions, you want to make the function available now in your * current shell? * Use source to execute the file you put the function in, for example, * $ source...
Words: 447 - Pages: 2
...experience and its translation into words suggesting an experience of great intensity. The setting is an old Boche dug-out’ which a party of English troops has taken, but not without being seen: consequently, it comes under enemy fire, ‘shell on frantic shell’ pounding its position. The co-opted dug-out is a ‘hell’ on earth, not only because of the artillery bombardment, but also because of the bad weather. It is raining heavily: into the dug-out pour ‘waterfalls of slime’ with the result that the men stand in ‘slush waist-high’ and cannot climb out. The first line “We'd found an old Boche dug-out, and he knew,” owen uses “he” as a derogatory term for all the soldiers of the opposition. This line is also an enjambment as the first line and its thought continues to the next line. The second and third line describe the “shells” or bombs “And gave us hell, for shell on frantic shell Hammered on top, but never quite burst through” – here owen describes how the shells never penetrated into the place they were, but the shells were close. He also uses a figure of speech, namely personification, to describe the shells as frantic. The words “hell” and shell” in the second line have an internal rhyming. And the repition of the word shell tells the readers that the bombing was one after the other. The next to lines tells the readers how the bad weather adds on to the soldiers misery, how even nature was not on their side now. “waterfall made of slime” is an oxymoron because...
Words: 968 - Pages: 4
...containing one or two shells with a few exceptions. They are soft-bodied bilaterally symmetrical animals with organs present in a fluid-filled cavity hence soft bodied referring to word mollusc (latin). Classification of the Molluscs has major turmoil of instability in the Animal Kingdom. Since, most of the resources and text books use old system of classification, and that is stable, easy to recognize, and complies with Cambridge Zoology Museum, so we are adapting that very system for their identification. Habitat of Molluscs Molluscs occupy mostly marine and moist environments that are why some of them have rudiments of amphibians they kept along during the evolutionary attempts. Some of the gastropods however, dwell in the freshwater also. Others occupy the bottoms of lakes depending on their feeding habits. Some of the molluscs reach the terrestrial environments e.g. snails and slugs. Habitat of the shells typically affect their adaptive structural formation and hence identification. The lines of the shells are dependent upon the tidal emersions. Also, the internal tidal indications of the structure indicate micro-growth line formation in molluscs from sub-tidal areas (Mirzaei et al., 2014). Classfication of the molluscs has classicaly been associated with the structure of the radula or structure of the shell. Within the phylum Mollusca, there are seven classes (Barnes et al., 1993); viz Aplacophora – solenogastrids and caudofoveates (without shells); Cephalopoda – octopi...
Words: 3266 - Pages: 14
...The Effectiveness of Using Mussel Shells as an Alternative Ingredient in Making Bricks Chapter I ABSTRACT Waste management has been a problem since then because lots of wastes are not used efficiently- needing the people to make a move to convert these wastes into useful things. Thus, this study is undertaken to contribute to the ideas of waste management programs and to find out the effectiveness of mussel shells as an alternative material in making bricks. This study intends to make eco-friendly and affordable bricks by combining the powdered mussel shells, sand and cement with an appropriate ratios. A series of experiments were conducted to study the effect of using mussel shells on the compressive strength and percentage of water absorption of the bricks. The bricks were tested at the construction materials testing center and it proved that the bricks can hold enough strength and can absorb much water. It showed that the sample 1 (3tahong:1cement) has a compressive strength of 3.75MPa which means it is considered as a non structural brick and it has a percentage of water absorption of 13.02%. Since using mussel shell as a component in making bricks will only produce a non structural brick, the researchers conducted another set of samples. Sample 2 can carry more loads 325kN than the two other samples 3 and 4, 275kN and 115kN but sample 2 can absorb more water 19.26% than the other two, 15.7%. Chapter II Introduction Background of the Study ...
Words: 3024 - Pages: 13
...Installing Server Roles with a Batch File 1. What does the /w switch do? Why is it used? “¹/W switch specifies the warning level of the MIDL compiler.” 2. What is the goal of port scanning? ServerManagerCmd.exe command-line tool can be utilized to install or remove Server 2008 Roles and Features. “Type the following, in which name represents the command name of the role, role service, or feature that you want to remove, and then press Enter. The -restart parameter restarts the computer automatically after removal is complete, if a restart of the computer is required. ” ServerManagerCmd.exe -remove name –restart”² 3. What is the command to start the DHCP Server service? “To start the DHCP service, use the command/sbin/service dhcpd start. To stop the DHCP server, use the command /sbin/service dhcpd stop.”³ 4. What command is used to configure a DNS zone? “dnscmd [ServerName] /zoneadd ZoneName ZoneType [/dp FQDN| {/domain|/enterprise|/legacy}] /load”⁴ References 1. /W switch. (n.d.). (Windows). Retrieved March 20, 2014, from http://msdn.microsoft.com/en-us/library/windows/desktop/aa367383(v=vs.85).aspx 2. Dnscmd Syntax. (n.d.). : Domain Name System(DNS). Retrieved March 20, 2014, from http://technet.microsoft.com/en-us/library/cc756116(v=ws.10).aspx#BKMK_22 3. Removing Server Roles and Features. (n.d.). Removing Server Roles and Features. Retrieved March 20, 2014, from http://technet.microsoft.com/en-us/library/cc732257.aspx 4. Start or stop...
Words: 274 - Pages: 2
...As you have probably discovered by this point, sometimes a shell script does not execute because there is an error in one or more commands within the script. For example, perhaps you entered a colon instead of a semicolon or left out a bracket. Another common problem is leaving out a space or not putting a space in the correct location. Now that you have some experience developing shell scripts and have possibly encountered some problems, you can appreciate why it is important to have a tool to help you troubleshoot errors. The sh command that is used to run a shell script includes several options for debugging. Syntax sh [-options] [shell script] Dissection ■ In UNIX and Linux, it calls the command interpreter for shell scripts;and in Linux, it uses the Bash shell with the command interpreter ■ Useful options include: -n checks the syntax of a shell script, but does not execute command lines -v displays the lines of code while executing a shell script -x displays the command and arguments as a shell script is run Two of the most commonly used sh options are -v and -x. The -v option displays the lines of code in the script as they are read by the interpreter. The -x option shows somewhat different information by displaying the command and accompanying arguments line by line as they are run. By using the sh command with these options, you can view the shell script line by line as it is running and determine the location and nature of an error on a line when...
Words: 315 - Pages: 2
...blue or original aim-circles available through in-game settings - Visibility of aim-circles optimized - Crosshair colors optimized - Version of Artillery crosshair with shell travel time removed - XVM v3.5.0 included with config matching crosshair colors - Artillery and Tank Destroyer angle indicators moved to minimap (XVM) - Clock top left moved to config (XVM) - J1mB0’s logo added as player icon (XVM) 1.22 - World of Tanks v0.8.4 supported - Angle indicator added for Tank Destroyers 1.21 - World of Tanks v0.8.3 supported 1.20 - DebugPanel.swf reintroduced with clock - Font in FragCorrelation.swf fixed 1.19 - World of Tanks v0.8.2 supported - Clock removed - Angle indicator moved to FragCorrelation.swf 1.18 - World of Tanks v0.8.1 supported - Angle indicator for Artillery added - Clock added to DebugPanel 1.17 - World of Tanks v0.8.0 supported - Artillery aiming optimized - Angle indicator for Artillery removed 1.16 - World of Tanks v0.7.5 supported - My logo used as lag indicator - Center marker for Artillery angle indicator added - All sec changed to s 1.15 - World of Tanks v0.7.4 supported - Server side crosshairs removed - Performance optimized - Cassette indicators optimized - Angle indicator for Artillery added 1.14 - World of Tanks v0.7.3 supported - Distance indicators fixed - Design tweaked - Shell travel time added to crosshair_panel_strategic.swf - Max reload...
Words: 549 - Pages: 3
...systems administration and security are also examined. Policies Faculty and students/learners will be held responsible for understanding and adhering to all policies contained within the following two documents: • University policies: You must be logged into the student website to view this document. • Instructor policies: This document is posted in the Course Materials forum. University policies are subject to change. Be sure to read the policies at the beginning of each class. Policies may be slightly different depending on the modality in which you attend class. If you have recently changed modalities, read the policies governing your current class modality. Course Materials Blum, R. (2008). Linux® command line and shell scripting bible. Indianapolis, IN: Wiley. Love, P., Merlino, J., Zimmerman, C., Reed, J. C., & Weinstein, P. (2005). Beginning Unix®. Indianapolis, IN: Wiley. Software RedHat Linux 5 (Virtual Desktop) Article References Ahmed, M. F., & Gokhale, S. (2009). Reliable operating systems: Overview and techniques. IETE Technical Review, 26(6), 461–469. Anthes, G. (2009, June 20-July 27). UNIX turns 40. Computerworld, 43(24), 16. Berlot, M., & Sang, J. (2008, January). Dealing with process overload attacks in UNIX. Information Security Journal: A Global Perspective, 17(1),...
Words: 1560 - Pages: 7