Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
185 views

Korn and Bash Shell Programming Lab Exercises

Korn and Bash Shell Programming Lab exercises

Uploaded by

hassan.oumarr
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
185 views

Korn and Bash Shell Programming Lab Exercises

Korn and Bash Shell Programming Lab exercises

Uploaded by

hassan.oumarr
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

V4.

cover

 Front cover

Korn and Bash


Shell Programming
(Course code AL32)

Lab Setup Guide


ERC 1.0

IBM Certified Course Material


Lab Setup Guide

Trademarks
IBM® is a registered trademark of International Business Machines Corporation.
The following are trademarks of International Business Machines Corporation in the United
States, or other countries, or both:
AIX® AIX 5L™ Language Environment®
OS/2® POWER™ RISC System/6000®
RS/6000®
Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the
United States, other countries, or both.
Windows is a trademark of Microsoft Corporation in the United States, other countries, or
both.
UNIX® is a registered trademark of The Open Group in the United States and other
countries.
Linux® is a registered trademark of Linus Torvalds in the United States, other countries, or
both.
Other company, product, or service names may be trademarks or service marks of others.

October 2007 edition

The information contained in this document has not been submitted to any formal IBM test and is distributed on an “as is” basis without
any warranty either express or implied. The use of this information or the implementation of any of these techniques is a customer
responsibility and depends on the customer’s ability to evaluate and integrate them into the customer’s operational environment. While
each item may have been reviewed by IBM for accuracy in a specific situation, there is no guarantee that the same or similar results will
result elsewhere. Customers attempting to adapt these techniques to their own environments do so at their own risk.

© Copyright International Business Machines Corporation 2007. All rights reserved.


This document may not be reproduced in whole or in part without the prior written permission of IBM.
Note to U.S. Government Users — Documentation related to restricted rights — Use, duplication or disclosure is subject to restrictions
set forth in GSA ADP Schedule Contract with IBM Corp.
V4.1
Lab Setup Guide

TOC Contents
Trademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v

Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii

Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

Set Up Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Configuration Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

Hardware Set Up Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

Additional Software Set Up Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

Verification Procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

© Copyright IBM Corp. 2007 Contents iii


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Lab Setup Guide

iv Korn and Bash Shell Programming © Copyright IBM Corp. 2007


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Lab Setup Guide

TMK Trademarks
The reader should recognize that the following terms, which appear in the content of this
training document, are official trademarks of IBM or other companies:
IBM® is a registered trademark of International Business Machines Corporation.
The following are trademarks of International Business Machines Corporation in the United
States, or other countries, or both:
AIX® AIX 5L™ Language Environment®
OS/2® POWER™ RISC System/6000®
RS/6000®
Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the
United States, other countries, or both.
Windows is a trademark of Microsoft Corporation in the United States, other countries, or
both.
UNIX® is a registered trademark of The Open Group in the United States and other
countries.
Linux® is a registered trademark of Linus Torvalds in the United States, other countries, or
both.
Other company, product, or service names may be trademarks or service marks of others.

© Copyright IBM Corp. 2007 Trademarks v


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Lab Setup Guide

vi Korn and Bash Shell Programming © Copyright IBM Corp. 2007


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Lab Setup Guide

LSGp Purpose
This Lab Set Up Guide provides directions for installing, preparing, and verifying the lab
hardware and software in preparation for conducting a class of course AL32.
The Requirements sections of this document may also be used to determine the specific
hardware and software needed to conduct a class.

© Copyright IBM Corp. 2007 Purpose vii


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Lab Setup Guide

viii Korn and Bash Shell Programming © Copyright IBM Corp. 2007
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Lab Setup Guide

LSG Requirements
The following tables list the hardware, software, and other materials needed to set up a lab
to conduct a class of course AU23.

Hardware Requirements
Table 1 lists the hardware needed to prepare one student lab set. Students may share an
RS/6000 if they log in using different user names, but each student needs own terminal.
Table 1: Hardware for one student lab set
Platform Use Machine Minimum
Minimum Free DASD Features
Machine Type Model Memory
CD-ROM,
2 x 9.1 GB Ethernet or
Student 43p Mod 150 128
hard disks Token-Ring,
printer
CD-ROM,
2 x 9.1 GB Ethernet or
Instructor 43p Mod 150 128
hard disks Token-Ring,
printer

Software Requirements
Table 2 lists the software needed to prepare the student and/or instructor lab set(s). When
preparing for a class, be sure you have the correct number of licensed copies of any
non-IBM software.
Table 2: Software needed
Operating Application Licensing
Platform Use OS Version Applications
System Version Requirement
POWER AIX 5L 5.2 5765-E62

Special Materials Requirements


Table 3 lists the tools the instructor and/or students will need during the class. Quantities
are specified for either each lab set, or for the entire class.
Table 3: Tools needed for class
Au23labfiles.tar

© Copyright IBM Corp. 2007 Requirements 1


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Lab Setup Guide

Special Materials Requirements


Table 4 lists any special materials or supplies such as configuration diskettes, project
tapes, or bugged logic cards needed to conduct the class. Quantities are specified for each
class, each lab set, or each student.

Table 4: Special Materials needed for class


Item Description Entire Class Each Lab Set Each Student
AIX 5L V5.2
6 CDs 1x
BOS
AIX 5L V5.2
1 CD 1x
Expansion Pack
AIX 5L V5.2
Documentation
1 CD CD 1x1

AIX Toolbox for


Linux
Applications for
POWER
Systems
1 CD 10/2002 release 1x
(cd#
LCD4-1077-06).

Skills Required to Set Up the Lab


The following specialized skills are required to set up the lab:
• Installation of AIX using NIM or mksysb or Installation CDs.
• Installation of additional AIX filesets using smit.
• Installation of AIX user using smit and setting passwords.
• Installation of RPMs using the rpm command
• Installation of the lab files using the tar command.
• Ability to edit a configuration file (using an editor such as vi)
• Configuration of the IP-addresses and hostnames.
• Configuration of IBM 3151 ASCII terminals.

2 Korn and Bash Shell Programming © Copyright IBM Corp. 2007


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Lab Setup Guide

LSG Set Up Instructions

Installation of O/S (AIX 5.2) (Part A is using a standard


distribution CD or tape from IBM Part B is using a mksysb tape)

A. Using a standard distribution CD or tape from IBM.


(On the PCI RISC System/6000, it will be a CD.)
__ 1. At this point, all systems should be turned off. On the classical RISC System/6000,
turn the key to the service position.
__ 2. Turn on all attached external devices, such as terminals, CD-ROM drives, tape
drives, monitors, and external disk drives.
__ 3. Insert the installation media into the tape or CD-ROM drive.
Note: You may find that on specific hardware, the tape drive door will not open while
the system unit is turned off. If you have trouble opening the tape drive door during
installation, use the following procedure:
Turn the system unit on.
Press the tape drive door button. You may need to try this more than once before
the door opens.
When the door opens, insert the AIX Version 5.2installation tape.
Turn the system unit off and wait for 30 seconds before proceeding.
__ 4. Turn the system unit power switch to on. The system will begin to boot from the
installation media.
__ 5. After several minutes a screen is displayed on each of your attached terminal
devices that prompts you to define the system console. The instructions will be
given in 8 different languages.
Follow the instructions as they appear on the graphics terminal, the preferred device
for the system console.
__ 6. Next, a screen is displayed that prompts you to select an installation language.
Follow the directions on this screen to select the language in which installation
instructions will be displayed.
__ 7. You will now be presented with the Welcome to the Base Operating System
Installation and Maintenance screen. Select Change/Show Installation Settings and
Install, which is item #2.
__ 8. The next screen you will be presented with is the Installation and Settings screen.
Select item 1, System Settings.

© Copyright IBM Corp. 2007 Set Up Instructions 3


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Lab Setup Guide

__ 9. You will then be presented with the screen Change Method of Installation. Select
New and Complete Overwrite, item 1.
__ 10. The next screen is Change Disk(s) Where You Want to Install. If you have more than
one disk drive, select at least two of them as the target drives. On PCI RISC
System/6000 Systems, make a note of the eight digit number that looks like
04-C0-00-5,0. You will need to know this later. Press Enter when you are finished
with this screen.
__ 11. On the Installation and Settings menu, choose option 2 to change the Primary
Language Environment before continuing. The default is C (POSIX). You need to
select the correct language for your country at this time so the proper files are
loaded from the media. In the United States, choose United States English and then
choose #1 to select the default keyboard.
Once all items have been properly selected, choose item 0 from the Installation and
Settings menu to continue with the installation.
__ 12. On Classical RISC System/6000 systems ONLY
Turn the key to the normal position. If you forget to do this, you will be prompted to
do so prior to completion of the installation.
The load process will take about 50 minutes.
On PCI RISC System/6000 systems ONLY:
If using a 43P model 140 or 150, the system will reboot automatically. This
section can be skipped unless the bootlist needs to be changed. To change the
bootlist, follow the directions below, but instead press the F1 key to access the
System Management Services program.
If using a 40P or 43P model 7248, the screen that will display after the
installation is complete states:
Remove the installation media.
Press the ENTER key to restart (reboot) the system.
Follow the instructions. For PCI RS/6000 systems that use the System Management
Services (SMS) diskette, be sure that the diskette is in the diskette drive. When the
first screen appears, after the keyboard icon but before the last icon appears, press
the F4 key.
Select Item 2 - Select Boot Devices
Select Item 1 - Display Current Settings
Number 3 on the boot sequence should be for a SCSI disk drive. Note the ID of this
device.
1) Press Enter
2) Select Item 6, configure 4th Boot Device. DO NOT PRESS ENTER

4 Korn and Bash Shell Programming © Copyright IBM Corp. 2007


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Lab Setup Guide

LSG 3) Highlight the SCSI disk with the ID number that is different from the one you
recorded above.
4) Press Enter.
5) Check the list that comes up next to verify you have the correct disk drives in
the list
6) Press Enter
7) Press Esc to quit
8) Press F3 to reboot
9) Answer YES to the question, “Do you want to restart the computer?”
When the system boots after AIX is loaded, you will get a screen titled 'Configuration
Assistant TaskGuide'. Take note if you receive an error message about the amount
of page space on your system. If you receiver this message, it will be necessary to
perform step “c” below. Click on Next to begin customizing the systems for the
classroom environment.
Click on Set or verify system date and time on the Configuration Assistant
TaskGuide menu. Then, click on Next Follow the instructions on the screen to set
the date and time as appropriate to your time zone.
Click on Next to return to the Configuration Assistant TaskGuide to complete the
next steps.
If you received a message indicating that more page space is needed, click on
Manage system storage and paging space, then click on Next. Click on the
recommended value and then click on Next.
Click on Set Password for administrator on the Configuration Assistant menu. Then
click on Next. Follow the instructions to enter ibmaix twice. Click on Next twice to
return to the Configuration Assistance TaskGuide menu.
OPTIONAL: Configure TCP/IP. Using the Configuration Assistant, click on Configure
network communications (TCP/IP) and then click on Next. Then, choose the option
to Manually configure TCP/IP and click on Next.

B. Using a mksysb tape:


Below you will find instructions for the classical RISC System/6000 and the PCI RISC
System/6000. Be sure you use the appropriate section for your installation.
For the classical RISC System/6000
__ 1. Follow the installation steps 1-6 above.
__ 2. Select Start Maintenance Mode for System Recovery from the Welcome to Base
Operating System menu. When this option is selected, you will be presented with a
Maintenance screen.

© Copyright IBM Corp. 2007 Set Up Instructions 5


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Lab Setup Guide

__ 3. Select Install from System Backup. Selecting this item will bring up the menu
Choose Tape Drive. There is a long wait before a rotating bar appears at the bottom
of the screen. Finally, you will get the message to select your installation language
again.
__ 4. The next screen is the Welcome to Base Operating System menu again. This time
select item 2, Change/Show Installation Settings and Install. The next menu will be
System Backup Installation and Settings.
__ 5. Select item 1 to choose a disk.
__ 6. The next screen is Change Disk(s) Where You Want To Install. Select BOTH of the
disk drives.
__ 7. You will be returned to System Backup Installation and Settings menu. Take the
defaults of no for “use map” and no for “shrink fs”. Continue with the installation and
system will reboot when installation is complete.
Login to the system as root.

For the PCI RISC System/6000


__ 1. Be sure a bootable CD is in the CD-ROM drive drawer, power the system off.
__ 2. Turn on all attached external devices, such as terminals, CD-ROM drives, tape
drives, monitors, and external disk drives.
__ 3. Turn the system unit power on. The system will begin to boot from the CD.
__ 4. After several minutes a screen is displayed on each of your attached terminal
devices that prompts you to define the system console. The instructions will be
given in eight different languages. Follow the instructions as they appear on the
graphics terminal, the preferred device for the system console.
__ 5. Next, a screen is displayed that prompts you to select an installation language.
Follow the directions on this screen to select the language in which installation
instructions will be displayed.
__ 6. Select Start Maintenance Mode for System Recovery from the Welcome to Base
Operating System menu. When this option is selected, you will be presented with a
Maintenance screen.
__ 7. Select Install from System Backup. Selecting this item will bring up the Choose Tape
Drive. Select the tape drive that contains the non-bootable mksysb image. There is
a long wait.
__ 8. The next screen is the Welcome to Base Operating System menu again. This time
select item 2, Change/Show Installation Settings and Install. The next menu will be
System Backup Installation and Settings.
__ 9. Select item 1 to choose a disk.

6 Korn and Bash Shell Programming © Copyright IBM Corp. 2007


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Lab Setup Guide

LSG __ 10. The next screen is Change Disk(s) Where You Want to Install. If you have 2 disks,
install using BOTH disks.
You will be returned to System Backup Installation and Settings menu. Take the
defaults of no for “use map” and no for “Shrink fs”. Continue with the installation.
__ 11. The screen that will display after the installation is complete states:
Remove the installation media. Press the ENTER key to restart (reboot) the system.
Login to the system as root.

End of section for the PCI RISC System/6000

© Copyright IBM Corp. 2007 Set Up Instructions 7


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Lab Setup Guide

8 Korn and Bash Shell Programming © Copyright IBM Corp. 2007


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Lab Setup Guide

LSG Configuration Information


The following describes the configurations of the student and/or lab set systems.
• Hostname for the first system is sys1 with IP-address 10.0.0.1 and subnetmask
255.255.255.0.
• Hostname for system x is sysx with IP-address 10.0.0.x and subnetmask
255.255.255.0.
• Update the file /etc/hosts on each machine that every host of your network has there an
entry.
• Password for root is set to ibmaix
The default user interface should be ASCII (command line). CDE should NOT be set as
default user interface. If COSE/CDE is installed, it will be the default. Disable it by going
into SMIT with the fastpath system (type “smit system”). Select Change System User
Interface. On the next screen, press F4, for listing of the Login User Interface, and select
Command Line. For this change to take effect, you will need to shutdown and reboot the
system. If CDE has not been installed, the option to Change System User Interface will not
appear on the System Environments menu. Thus, the interface will be the command line.

© Copyright IBM Corp. 2007 Configuration Information 9


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Lab Setup Guide

10 Korn and Bash Shell Programming © Copyright IBM Corp. 2007


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Lab Setup Guide

LSG Hardware Set Up Instructions


Use the following information in addition to the normal hardware installation procedures to
set up the lab hardware.
__ 1. Configure the IBM 3151 ASCII terminal.
Ascii terminals are no longer part of the world-wide standard classroom system
setup. However, if they are still in use in your classroom, before configuration, they
will first need to be cabled to the S1 serial port off the back of the RS/6000. If you
are using standard IBM serial cables, you will need a null modem, also called an
interposer.
__ 2. To configure an IBM3151 terminal under AIX do the following:
“smit tty” Add a TTY tty rs232 Asynchronous Terminal
sa0 Available 01-S1 Standard I/O Serial Port Fill in: Port number 0, Enable LOGIN
enable, Terminal type ibm3151 and press enter.
__ 3. On the ASCII terminal keyboard, press and hold the ctrl key and press the setup
key. This puts you in setup mode. The cursor keys move you from one field to
another. The space bar shows you the options for whatever field is highlighted. The
Send key takes you to the next screen.
This is what the settings should look like on the General menu:
Machine Mode = IBM 3151
Screen = NORMAL
Row and Column = 24x80
Scroll = Jump
Auto LF (line feed) = OFF
CRT Saver = ON
Line Wrap = ON Forcing
Insert = OFF
Tab = Field
__ 4. Press the Send key.
__ 5. You should now be at the Communication menu. Check to be sure the line speed
(baud rate), word length, parity, and stop bit match the system default selections of
9600, 8, NO, and 1. The operating mode should be ECHO.
This is what the settings should look like on the Communication menu:
Operating Mode = ECHO
Line Speed (bos) = 9600

© Copyright IBM Corp. 2007 Hardware Set Up Instructions 11


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Lab Setup Guide

Word Length (bits) = 8


Parity = NO
Stop bits = 1
Turnaround Characters = CR
Line Control = IPRTS or PRTS
Break Signal (ms) = 500 Send
Null Suppress = ON
__ 6. If you have to make any changes, use the cursor key to take you to the appropriate
field, then use the space bar to cycle through the selections. Once you have made
all the changes, press the Send key. Check the values for the Keyboard menu.
Entries should be RETURN, FIELD, CR, PAGE, SPACE.
This is what the settings should look like on the Keyboard menu:
Enter = RETURN
Return = NEW LINE
New Line = CR
Send = PAGE
Insert Character = SPACE
__ 7. Press the Send key again.
__ 8. You should now be on the Function menu that will allow you to save your changes.
Press the right arrow key once to Save. Press the space bar to save the changes.
The word Completed should be flashing.
__ 9. Press and hold the ctrl key and press the setup key to exit setup mode.

12 Korn and Bash Shell Programming © Copyright IBM Corp. 2007


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Lab Setup Guide

LSG Additional Software Set Up Instructions


Use the following information in addition to the normal software installation procedures to
set up the lab software. Log in as root to do the following steps:
__ 1. Install the bash shell from AIX Toolbox for Linux Applications for POWER Systems
10/2002 release (cd# LCD4-1077-06). To install:
Make sure /mnt exists (if not, “mkdir /mnt”)
mount -vcdrfs -oro /dev/cd0 /mnt
cd /mnt/RPMS/ppc
rpm -i bash* (this should install both the product and the product documentation)
umount /mnt
__ 2. Edit /etc/security/login.cfg and add /usr/bin/bash as a valid login program by adding
it to the list of “shells”.
__ 3. Next, create users by using smit mkuser. The specifications for the users are as
follows:
- team01 through team05 whose initial program is /usr/bin/ksh (you may take all the
defaults under smit mkuser.)
- bash01 through bash05 whose initial program is /usr/bin/bash. (You must fill in the
“initial program” entry in smit mkuser with /usr/bin/bash.)
- ksh9301 through ksh9305 whose initial program is /usr/bin/ksh93. (You must fill in
the “initial program” entry in smit mkuser with /usr/bin/ksh93.)
__ 4. Set their passwords to the same as their user name using the command “passwd
team01”, etc, for each user
__ 5. Clear the ADMIN flag of this new password by using pwdadm -c team01
__ 6. Install the lab files into the directory /home/workshop. First cd /home and then tar
-xvf au23labfiles.tar
__ 7. Install from AIX 5L V5.2 BOS CD3 the fileset Java 1.3.1.ext for the Java applets.
__ 8. Install from AIX 5L V5.2 Expansion Pack CD the fileset Netscape.communicator for
the Web browser and the fileset http_server.base for the IBM HTTP Server
Webserver.
__ 9. Install from AIX 5L V5.2 Documentation CD all documentations.
__ 10. (Optional if you have printers available) Copy from AIX 5L V5.2 BOS CD3 all printer
support to /usr/sys/inst.images for future installation. First extend the /usr filesystem
by at least 6.4 MB. Then use smit bffcreate, select cd0 and type in printers

© Copyright IBM Corp. 2007 Additional Software Set Up Instructions 13


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Lab Setup Guide

14 Korn and Bash Shell Programming © Copyright IBM Corp. 2007


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Lab Setup Guide

LSG Verification Procedures


Use the following information to verify the installation and configurations of the lab and/or
instructor systems.
__ 1. Check if the directory /home/workshop contains the following files and are readable
by everyone (type in “cd /home/workshop” and then “ls -la” to check all files are
installed and have at least permissions rw-r-r--): (These files are from
au23labfiles.tar)

.bash_profile eval.bash picalc.bash


.bashrc eval.ksh picalc.ksh
.exrc faster.better.ksh pickacard.ksh
.kshrc fileperm.bash pickc.ksh
.profile fileperm.ksh prefix.awk
add filesyscheck prefix2.awk
add.bash fleas prog.bash
add2 for-in.bash replace.awk
add3 for-in.ksh results
add3.bash for.awk rolling.counter.bash
add4 getopts.example.bash rolling.counter.ksh
add4.bash getopts.example.ksh select.bash
add_bet getopts.example2.ksh select.ksh
array.awk if-then-elif.bash select2.bash
backdoorcheck.ex if-then-elif.ksh select2.ksh
backdoorchk.ex.bash if-then-else.bash settime.ksh
bad.box.ksh if-then-else.ksh trap.bash
begin.awk if-then.bash trap.ksh
bet if-then.ksh trap2.bash
bet.bash ipcheck trap2.ksh
better.faster.ksh ipcheck.bash trap3.bash
bigger.awk mail.list trap3.ksh
box.ksh mail.message until.bash
calculator.ksh monmax.sh until.ksh
cars1 nobegin.ksh until2.bash
cars2 param11a.bash until2.ksh
cars3 param11a.ksh usercount
cars4 param11b.bash usercount.bash
case.bash param11b.ksh vpdreport.bash
case.ksh param11c.bash vpdreport.ksh
chop.bash param11c.ksh walrus

© Copyright IBM Corp. 2007 Verification Procedures 15


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Lab Setup Guide

.bash_profile eval.bash picalc.bash


chop.ex param11d.bash while.awk
cread.sh param11d.ksh while.bash
devices.bash party.bash while.ksh
devices.ksh party.ksh
__ 2. Check if all relevant AIX documentation is installed by using the command lslpp -l |
grep AIX
__ 3. Check the user logins.
Login as the id: team01 (the password should be team01)
If you get a “$” prompt, type in “print $$”. Record this number. Then type in “ps
-f”. Find the number you recorded earlier under the column marked “PID”. On
that same line, look at the column labeled “CMD” -it should say “-ksh” or “ksh”
under that column. If so, log out (type in “exit” to logout). If not, the user was not
created correctly.
Next, log in as the id: bash01 (the password should be bash01)
If you get a “$” prompt, type in “echo $$”. Record this number. Then type in “ps
-f”. Find the number you recorded earlier under the column marked “PID”. On
that same line, look at the column labeled “CMD” -it should say “-bash” or “bash”
under that column. If so, log out. (type in “exit” to logout) If not, the user was not
created correctly. (In order to create a user whose login shell is a bash shell, the
root user must edit the file /etc/security/login.cfg and add /usr/bin/bash as a valid
login program by adding it to the list of “shells”.)
Next, log in as the id: ksh9301 (the password should be ksh9301)
If you get a “$” prompt, type in “print $$”. Record this number. Then type in “ps
-f”. Find the number you recorded earlier under the column marked “PID”. On
that same line, look at the column labeled “CMD” -it should say “-ksh93” or
“ksh93” under that column. If so, log out (type in “exit” to logout). If not, the user
was not created correctly.
__ 4. Login in as id: root (password should be ibmaix). Verify you get a “#” prompt.
Type in: df
Look at the “/dev/hd1” line, and make sure you have at least 6000 under the “Free”
column.
__ 5. In countries where the default LANG setting is not en_US, use the following to
ensure that the man page keywords are created.
#LANG=en_US
catman -w
__ 6. Make sure all terminals have a “login” prompt. (One terminal per student)

16 Korn and Bash Shell Programming © Copyright IBM Corp. 2007


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1
Lab Setup Guide

LSG

© Copyright IBM Corp. 2007 Verification Procedures 17


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Lab Setup Guide

18 Korn and Bash Shell Programming © Copyright IBM Corp. 2007


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V4.1

backpg
Back page
®

You might also like