Index

A append , , perl utility for, 437 abbreviations for directories, 343-344, 343 Portable Application Integrated System (IFS) application development, Solutions Environment and, 118, 433-457 (PASE), 434 absolute permissions, 139-143 Andrew Toolkit (ATK) and, QIBM_CCSID variable and, accessing OS/400-specific 437, 438 437 objects, 401-431 ASCII data and, 436-438 source code editors for, 433 dataq utility in, 414-417, and C++, 433, 434 utility and, 437 datarea utility and, 410-414, CCSIDs and, 438 Virtual Network Computing , compilers and, 433-434 (VNC) and, 440-443, db2 utility in, 417-426, ez editor utility, 443-457 XFree86 window manager - customization of, for, 435, 439 liblist utility in, 406-409, 447-449, archive utility, 286 Programming Development file formats in, 450-455 archives and compression, Manager (PDM) and, 402 hex edit in, 455-457 285-303 Rfile utility in, 417, Java example of, 454, archive utility for, 286 426-430, - and uncompress spooled data and, 402-405, key bindings in, 448 utilities for, 300-303, key bindings in, 444-446, and, 285, 296, 494-496 utility and, 296-300, SQL scripts and, 421-423 - mrhex utility and, 457 system utility in, 401-406 query and replace PkZip and WinZip and, 296, sysval utility and, 409-410 responses in, 446, 495 Add Link (ADDLNK), 360 style editor in, 451-452 sample data for, 286 Add Prestart Job Entry template files in, and, 285, 286-295 (ADDPJE), 20 450-455, , zcat utility and, 302-303 ADDLNK, 558 undo capability in, 457 and, 285 address command, sed, 327-328 graphical utilities for, arguments (See also command ajar, 547 438-443 line arguments), 41-42, 197 utility, 214-215 Andrew Toolkit (ATK) utility and, 233-235 aliases for data types, 53, and, 438 arithmetic expansion, 76-78, 214-215 Virtual Network 236 child processes and, Computing (VNC) arithmetic expression exporting to, 224 and, 440-443, comparison, 94-95, And (&&) operator, 97-100, 97 X Windows servers for, arithmetic expressions, 73-78, Andrew File System (AFS), 438 438-440 arithmetic operators, Andrew Toolkit (ATK), 438 hex edit in, 455-457 arrays, perl utility and, application development iSeries Tools for Developers 462-464, - and, 437 in, 434-436 ASCII files, 3 Andrew User Interface System Java and, 433, 434 application development (See Andrew Toolkit) Perl and, 434 and, 436-438

561 Index

ASCII files, continued call level interface (CLI) converting text using, hex edit in, 455-457 and, 535 111-113 ixlc utility (V5R2) and, 517 compiling, using icc utility, patterns in, 110-111 javac utility in, 485-486, 513-521 wildcard characters in, database files and ODBC in, 110-111, perl utility and, 461 535-541 case sensitivity tar and, 286 error handling in, 541 DOS vs. Qshell, 551 attr, 146, 1467, 543, 556 examples of, 521-541 EDTF text editor and, 24 CCSIDs and, 146, 147 icc utility in, 513-516 globbing and, 262-263 authority EBCDIC files and, 513 and, 306 command in, 136 status and output Integrated File System (IFS) command in, 135 using, 516 and, 123-125 group and group profile in, options for, 514, - , 117, 547, 553, 554, 556 135 program creation using, input and output in, 165 Integrated File System (IFS) 515-516 Integrated File System (IFS) and, 135-136 and, 132 soft link creation using, 513 CCSIDs, 146-152, 438 attr utility in, 147 B icc vs. ixlc selection in, converting, using back references, grep and, 309 520-521 utility, 150-151 background command IFS file descriptor APIs in, utility and, 149-150 execution, 228-230 381-383 displaying file attributes of, , 547, 556 interactive lookup , , attr commands, , 2 application using, 522-527 146-147 batch jobs and Qshell, 14-15 ixlc utility (V5R2) in, file comparisons using, Berkeley Software Design 517-520 151-152 (BSD), 3 ASCII files and, 517 file creation and, 148 binding to C functions, RPG options in, 517, - preserving attributes for, programming and, 362-364 newline character in, during copy, 149-150 bottom-tested loops, 100, 104 383-385 QIBM_CCSID environment Bourne , 1, 2, 3 passing parameters to variable in, 148-149, break, 102-103, 106 programs in, 391-392 - for loops and, 106 RPG programming and, setccsid utility in, 147 buffers in sed, 324 binding to C functions in, setting, in existing files, 147 built-in utilities, 207, 208-209, 362-364 tar and, 287 standard input/output touch utility in, 148 builtin command, 225, 543 functions in, 379-381 , 557 system utility and Qshell cd command, 43, 119, 125, C command invocation, 527 553, 555 C and C++ programming, 359, , 1 CDPATH, 57 378-385, 513-541 call level interface (CLI), 535 change command API applications in, 527-535 calling, running programs EDTF text editor and, 25 APIs available to, 378-379 within Qshell, 360-362 sed, 346-347 application development Campione, Mary, 483 Change Current Directory and, 433, 434 case construct, 110-113 (CHGCURDIR/CD), 28, 29

562 Index

Change Data Area passing parameters to command and, 210, (CHGDTAARA), 410 programs in, 397-400 211, 225 Change Owner (CHGOWN) command line arguments, utility and, 237-238 command, 135 197-206 utility in, 235 Change Primary Group argument defined for, 197 external, 207, 212-214 (CHGPGP), 136 conventional rules for, field splitting in, 236 Change System Value 197-199 command and, 229-230 (CHGSYSVAL), 409 error handling and, 206 functions and, 216 Change User Profile extracting values from, globbing in, 236 (CHGUSRPRF) command, 199-206 grep utility and, 234-235 118 fixed number of utility in, 227-228 Change User Profile non-option arguments Integrated File System (CHGUSRPRF), 135-136 in, 199-200 (IFS), 555-559 CHDIR, 557 getops utility and, interpretation of, 235-236 CHGATR, 558 201-206 locating, 224-228 CHGAUD, 559 OPTARG variable in, 203 magic number and, 210-214 CHGAUT, 559 OPTIND variable in, 204 command and, 230 CHGCURDIR, 557 utility and, 201 path variable in, 225-227 CHGOWN, 559 variable number of Portable Application CHGPGP, 559 non-option arguments Solution Environment chgrp command, 136, 547, 557 in, 200-201 (PASE) and, 207 child processes, 220, 222 getops utility and, 201-206 POSIX standards for, CHKIN, 558 OPTARG variable in, 203 208-209 CHKOUT, 558 processes and, 219-224 OPTIND variable in, 204 , 35, 547, 553, 557 QIBM_QSH_CMD_OUTP options in, 197-199 permissions and, 140-143, UT , Unix conventions in, 198 218-219 command line in Qshell, 12 chomp function, perl utility reserved words for, 216, and, 471 command substitution, 236 script interpreters and, chopfirst function, 246 and, 175 210-212 chown, 135, 547, 557 commands, 207-238 sed, 327-331 CKP files, undo capability and, aliases for, 214-215 simple and compound, 217 457 background execution of, source () utility in, classes, Java and, 483 228-230 231-233 clobbering, input and output in, built-in utilities as, 207, substitution of, 230-231 159 208-209, syntax, syntax errors and, clrtmp, 547 builtin command in, 225 208 CMD parameter CMD parameter for, command to show commands and, 217-219 217-219 implementation of, 207, interactive jobs and, 13-14 command-V command to 210 , 546 show implementation of, variable assignment in, 209 CCSIDs and, 151-152, 151 208 whence utility to show exit status and, 81 DOS vs. Qshell, 552-554 implementation of, 208, COBOL programming, 359, dual implementations and, 210 374-377 209-210 word expansion in, 235-236

563 Index

xargs utility and, 233-235 Create C Module interactive mode and, command-V command, 208 (CRTCMOD), 513 423-426 comments, scripting and, 36 Create Data Queue SQL scripts and, 421-423 compilers, application (CRTDTAQ), 414 DEBUG signal, 272 development and, 433-434 Create Directory debugging compound commands, 217 (CRTDIR/MD), 28 option settings for, 267-270, compound conditions, test Create Program (CRTPGM), - utility and, 95-97, 513 xtrace option for, 267-269 compounds statements, file Create User Profile declare utility, 241-242, 245, descriptors and, 193-195 (CRTUSRPRF), 28, 118, 135 543 Comprehensive Perl Archive CRTDIR, 557 parameters and variables, Network, 459 current directory, 219 50-53, 58 compress utility, 300-303, , Integrated File System (IFS) declaring variables, 49-50 546, 556 and, 117-121 DEL, 558 compression (See archives and Cygwin, 439 delcmt function, 243 compression) delete command, sed, 332-334 concatenating strings, 70-71 D Delete Data Queue conditional execution, 97-100, data areas, 410 (DLTDATAQ), 414 217 data queues, 414-417 die function, perl utility and, 479 constants, numeric, 71-73 data types, typed vs. untyped directories continue, 102-103 data, 50-53 Integrated File System (IFS) for loops and, 106 database files, 115 and, 116-117 continue statement, 102-103 C and C++ programming, scripting and, 33 control character sequences ODBC and, 535-541 , 547, 556 for print command, 169 call level interface (CLI) Display Command for printf, 171 and, 535 (DSPCMD), 401-402, 401 for dspmg, 179, db2 utility and, 417-426, Display Data Area control structures - (DSPDTAARA), 410 case construct in, 110-113 interactive mode of db2 Display Message (See dspmg for loops in, 105-107 utility and, 423-426 command), 176 select construct and, 107-110 Java and, JDBC and, 506 Display System Value conventions used, xv-xvi perl utility and, 478 (DSPSYSVAL), 409 conversion formatting Rfile utility in, 426-430, Display User Profile sequences for printf, - (DSPUSRPRF), 28 172-173, SQL scripts and, 421-423 documentation in Java (See cp, 547, 553, 554, 556 dataq utility, 414-417, , 543 javadoc utility), 487 CCSIDs and, 149-150 datarea utility, 410-414, , dollar sign ($) prefix, in CPY, 558 , 543 parameters and variables, CPYFRMIMPF, 558 date, 547, 553 54-55 CPYFRMSTMF, 558 input and output in, 165 dollar sign ($) prompt, 10, 11 CPYTOIMPF, 558 DB2 UDB/400 database files Integrated File System (IFS) CPYTOSTMF, 558 (See also db2 utility), and, 119-120, 119 Create C++ Module 417-421 DOS vs. Qshell, 551-554 (CRTCPPMOD), 513 db2 utility, 417-426, - case sensitivity and, 551

564 Index

commands comparison in, Edit File (EDTF) command exit command, exit status and, 552-554 and, 21, 82-83 options (switches) in, find command in, 24-25 EXIT signal, 272 551-552 function key assignments in, exit status, 81-104, 359 token separation, 552 26, break statement and, DSPAUT, 559 Line Prefix field editing 102-103 DSPCURDIR, 557 commands in, 25, 25- cmp utility and, 81 DSPLNK, 558 opening file in, 23-24, comparing arithmetic dspmg command, 176-181, 546 quotation marks in, 24-25 expressions and, 94-95, control character sequences revising stream file in, 30-31 comparing strings and, in, 179, Source Entry Utility and, 92-94, - message file creation for, 22-23 compound conditions and, 176-177, starting, 21-27 95-97, message not found display stream file exercises for, conditional execution and, in, 180-181 27-28 97-100 placeholders in, 178, , egrep, 318-319, continue statement and, 181 EGUID, 545 102-103 dual implementations, elif command, exit status and, echo command and, 85 commands and, 209-210 84-87 elif command and, 84-87 duplicate standard input (See End Job (ENDJOB), 280 evaluating status conditions in, 91-92, also utility), 163 End Request (ENDRQS), 278 evaluating file conditions env, 547 and, 88-91, - ENV environment variable, 57 E exit command for, 82-83 scripting and, 37 EBCDIC files, 3 extended conditional in, 88 environment variables, 219 hex edit in, 455-457 for loops and, 106 output and, 15 tar and, 286 functions and, 253-254 echo command, 78, 98, 101, ERASE, 558 grep and, 320-322, 176, 210, 211, 225, 553 ERR signal, 272 icc utility, 516 exit status and, 85 error handling if command and, 84-87 input and output in, 165, C and C++ programming, 541 looping structures governed 167, 168 Java and, 507 by, 100-102 Eckel, Bruce, 483 utility for, 270-273, nested ifs in, 86-87 Edit File (EDTF) command 280-283, retrieving ($ ? parameter), (See also EDTF), 21, , 323 pseudosignals for, 272 81, 82 EDTF text editor, 21-32, 323, signals for, 270-273 return utility and, 253-254 558 trap utility for, 270-280 setting, 82-83 application development EUID, 545 test utility for, 87-97 and, 433 eval utility, 237-238 true, false, null utilities for, case sensitivity in, 24 evaluating file conditions, test 83 change command in, 25 utility and, 88-91, - expanding variables, 59-64 CL command line for, 22, exec utility, 235, 544 arithmetic expansion in, Control Field editing executable commands, 76-78 commands in, 24, scripting and, 36-37 assigning new value for creating stream file in, 29-30 execute permission, 137, missing value in, 63

565 Index

expanding variables, continued file, 546, 553, 556 foreground command expansion operators for, file comparison, CCSIDs and, execution, 228-230 59-60, , 151-152 formatting flag values for generating error if value is file creation mask, 219 printf, 173, missing, 64 permissions and, 144-146 formatting sequences in, missing value in, 60-64 file descriptors, 185-195 171-172 temporary substitution for compounds statements and FTP applications existing value in, 62-63 redirection in, 193-195 script using file descriptors temporary substitution for FTP script using, 190-191 for, 190-191 missing values in, 61-62 input through, 188-189 sed, 349-350 expansion opening and closing, function key assignments, command, 235-236 187-188 12-13, - globbing and, 262 output through, 189-192 EDTF text editor and, 26, path name (See path name print command and, 189 functions, 216, 217, 239-255 expansions) redirection operators and, chopfirst, 246 expansion operators, 59-60, , 186-187, delcmt, 243 ulimit utility and, 187 deleting definitions of, unset export command, 120 while and for loops in, 193 utility in, 242-243 utility, 547 displaying definitions for, file formats, ez editor utility declare or typeset utility parameters and variables, 78 and, 450-455 in, 241-242, 245 extended conditional, exit file mode symbols, permissions exit status and, 253-254 status and, 88 and, 137, - external commands, 207, firstchar, 246 file systems (See also 212-214 global variables in, 245 Integrated File System), magic number and, 212-214 115-121, init function, 245, 249 ez editor utility, 443-457 invoking, with usage, 251-252 filenames, grep and, 314-315 customization of, 447-449, lastchar, 246, 254 filters lcname, 254 input and output in, 167-168 file formats in, 450-455 line-number function in sed, sed as, 323 hex edit in, 455-457 351-352 find, 229-230, 548, 556 Java example of, 454, parameters for, 243-245 EDTF text editor and, 24-25 key bindings in, 444-446, perl utility and, 466-469, - , 448 Find String Using PDM - (FNDSTRPDM), 305 mrhex utility and, 457 retrieving output from, query and replace responses firstchar function, 246 254-255 in, 446, floating point data types, 51, return utility and, 253-254 style editor in, 451-452 71, 72-73 sed, 329-331, - template files in, 450-455, for loops, 105-107, 553 special parameters and, 243 , break and continue in, 106 syntax for, 239-241 undo capability in, 457 done statement in, 106 variables in, 245-251 exit status for, 106 F file descriptors and, 193 G false utility, exit status and, 83 in parameter in, 105 Generate Message Catalog fgrep, 319-320, list in, 105 (GENCAT), 179 field splitting, 236 positional parameters in, 106 getconf, 547, 556

566 Index

getjobid, 547, 548 input and output in, program creation using, getops utility, 201-206 161-162, 164 515-516 GID, 545 metacharacters for, 306, soft link creation and, 513 global profile, scripting and, 37 - iconv, 543 global variables, 245 options for, 315-317, CCSIDs and, 150-151 globbing, 236, 257-263 quotes in, 311-313 id, 548 case insensitive file systems regular expressions and, if command, 99 and, 262-263 306-315 exit status and, 84-87 failure of, 265-266 search string in fgrep, 320, nested, 86-87 grep and, 314 IFS, 57 metacharacters for, 257-258, symbolic names for, 307, in parameter, exit status and, , 310, 311 105 metacharacters with a script syntax for, 305 init function, 245, 249 and, 259-262 group and group profile, inode numbers, Integrated File noglob option in set Integrated File System (IFS) System (IFS) and, 127, 129 command and, 264-265 and, 135 input and output, 153-195 preventing, 263-265 C and C++ programming, unmatched expansion H 379-381 expressions and, 262 hard links, Integrated File cat command and, 165 GOFSDIR, 557 System (IFS) and, 127-130, clobbering and, 159 GOFSOBJ, 558 - date command and, 165 GOFSSEC, 559 hash utility, 227-228, 544 dspmg command in, graphical utilities for , 548, 556 176-181 application development, , 543 duplicate standard input (See 438-443 here documents, 166-167 also tee utility) in, 163 Andrew Toolkit (ATK) and, hex edit, 455-457 echo command and, 165, 438 holding buffer, in sed, 324, 167, 168, 176 Virtual Network Computing 325, 355-356 file descriptors and, 185-195 (VNC) and, 440-443, HOME, 57 filters in, 167-168 X Windows servers for, home directory, Integrated File grep utility and, 161-162, 438-440 System (IFS) and, 117-121 164 grep, 234-235, 305-322, 408, HOSTID, 545 here documents and, 548, 553 hostname, 548 166-167 back references in, 309 HOSTNAME, 545 ls command in, 161 case sensitivity in, 306 HOSTTYPE, 545 noclobber option in, examples for, 308-311 Hummingbird Exceed, 439 159-161 exit status and, 320-322, operators and pipes for redirection in, 162-163 extended regular expressions I overriding redirection in, (egrep) and, 318-319 icc utility, 513-521 165-166 fgrep (fast or fixed grep) EBCDIC files and, 513 pipes and pipelines in, and, 319-320, exit status and output using, 161-162 filenames and, 314-315 516 print command and, 167, globbing and, 314 options for, 514, - 168-170, , 176

567 Index

input and output, continued current directory in, 117-121 interactive jobs and, 9-14, printf command and, directories in, 116-117 output area in, 10-12, 170-175 displaying contents of files terminal sessions read command and, 167, in, 132-135 (temporary) in, 14, 168, 181-185, EDTF text editor and, 21-32 interactive mode and db2 redirection in, 155-159 file creation and CCSIDs in, utility, 423-426 set utility in, 160-161 148 Internal Field Separators (IFS), command and, 167 file creation masks in, read command, 184 standard error (stderr) in, 154 144-146 interpretation of commands, standard files in, 153-154 file mode symbols in, 137, 235-236 standard input (stdin), 153 - interpreters (See script standard output (stdout) in, file systems included in, interpreters) 154 115-121, , 544 stream files in, 153 group and group profile in, , 544 switches and, 167 135 iSeries Navigator, 3 tee utility for, 163-165 hard links in, 127-130, iSeries Tools for Developers, terminal session in, 154 - 434-436, 521 utilities for, 168-185 home directory in, 117-121 perl utility and, 459, 460 insert command, in sed, inode numbers in, 127, 129 ixlc utility (V5R2) 343-344 library object names in, ASCII files and, 517 installing Qshell, 4-7, , , , 121-125, - C and C++ programming, Institute of Electrical and link removal in, 130 517-520 Electronics Engineers links in, 126-132 icc vs., 520-521 (IEEE), 2 ls command and, 129 options in, 517, - integer data types, 51, 71 od utility in, 134-135 Integrated File System (IFS), 3, organization of, 115-121 J 21, 115-152 paths in, 121-126 jar (See also archives and abbreviations for directories permissions in, 137-146, compression; Java), 285, in, 118, , 296, 494-496 authority in, 135-136 utility in, 133-134 action options for, 494, C and C++ programming prompt string in, 119-120 options for, 495, APIs and, 381-383 QSYS.LIB and, 121-124 Java, 3, 9, 359, 386-390, calling programs with relative paths in, 125-126 481-511 Qshell using, 123 Rfile utility in, 133 application development case sensitivity and, 123-125 scripting and, 33 and, 433, 434 cat utility in, 132 symbolic or soft links in, 127, classes in, 483 CCSIDs and, 146-152 131-132, - CLASSPATH setting in, chgrp command in, 136 user classification for 497, 507 chmod operators for permissions in, 138, database files and JDBC in, permissions in, 140-143, interactive jobs and Qshell, 506 9-14, documentation in (See chown command in, 135 CMD parameter for, 13-14 javadoc utility) CL commands for, 557-559 command line in, 12 examples for, 496-511 commands for Qshell and function key assignment for, exception handing in, 507 CL, 555-559 12-13, - ez editor utility and, 454,

568 Index

invoking Qshell commands kill utility, 270-273, 280-283, command, 548, 553, 556 in, 503 links and, 127-128, 131 jar (See also jar), 484, Korn shell, xiv, 1-2, 3, 34 locale, 544 494-496 Korn, David, 1 locating commands, 224-228 java utility in, 481-485, 497 logger, 548 jar and, 484 , 548 java class and files, 483 L lookup method, Java and, 500 options for, 482, lastchar function, 246, 254 looping structures, 217 packages in, 483-484 lcname function, 254 exit status and, 100-102 running, 482-483 length of value, parameters and lowercase/uppercase character system properties in, variables, finding, 69-70, 74, data, 51 484-485, - 77 ls command, 10-12, 35, 125, Java Virtual Machine (JVM) let, 548 154, 547, 548, 555 and, 484 parameters and variables, CCSIDs and, 146-147 javac utility in, 485-486, 74, 75-76 datarea utility and, 413 , 497 liblist utility, 406-409, , functions and, 250 javadoc utility in, 487-493 549 globbing, 266 comments in, 487 library objects, Integrated File input and output in, 161 example of, 490-493, System (IFS) and, 121-125, links and, 129 HTML document - permissions and, 137, generated by, 487 LINENO, 56 138-139 options for, 488-489, line-number function, sed, running programs within - 351-352 Qshell, 360-362 running, 488 links, 127-132 tags in, 489, - Add Link (ADDLNK), 360 lookup method in, 500 hard link limitations in, 130 M packages in, 483-484 hard, 127-130, - MACHTYPE, 545 passing parameters to Integrated File System (IFS) magic number programs in, 392 and, 126-132 commands and, 210-211 regular expressions and, 504 ln command for, 127-128, external commands and, string manipulation in, 500 131 212-214 system utility and, 503-504 ls command and, 129 scripting and, 36 Java Database Connectivity removing, 130 match function, perl utility and, (JDBC), 506 running programs within 471 Java Tutorial, The, 483 Qshell, 360-362 MD, 557 java utility, 481-485, 497 symbolic or soft, 127, memory mapped files, in Unix, Java Virtual Machine (JVM), 131-132, - 401 484 tar and, 291, 292 Merge Message Catalog javac utility, 485-486, , 497 Linux, 2 (MRGMSGCLG), 179 javadoc utility, 487-493 Linux shells, 1-2 message files, dspmg JOBNAME, 56 list, exit status and, 105 command, 176-181, List Directory Contents (See ls message queues, in Unix, 401 command), 154 metacharacters K list nonprinting characters globbing, 257-258, key bindings, ez editor utility command (l), sed, 347 grep and, 306, - and, 444-446, - , 448 lists, 217 sed, 328,

569 Index

middle-tested loops, 103 arithmetic, expr utility in, 78 missing values, expanding perl utility and, 465-466, functions and parameters, variables and, 60-64 - 243-245 , 548, 553, 555 OPTARG variable, 203 functions and variables, MKDIR, 557 OPTIND variable, 204 245-251 mkdir command, 117 options global variables in, 245 mkfifo, 544, 556 command line arguments init function in, 245, 249 MOV, 558 and, 197-199 length of value in, finding, mrhex utility, 457 DOS vs. Qshell, 551-552 69-70, 74, 77, 246, 248 multithreading, 3 Or (pipe) operator, 97-100 let utility in, 74, 75-76, 75 , 548, 553, 554, 556 OSTYPE, 545 missing value in expansion output area, interactive jobs of, 60 N and, 10-12, null values in, 55-56 need for Qshell, 3 output redirection, 15-20 numeric constants and, nested ifs, exit status and, 71-73 86-87 P offset and, 66, 74 newline character, C and C++ packages, Java and, 483-484 option parameters in, programming, 383-385 parameter expansion, 236 391-400 next command, sed, 352-354 parameter substitution, passing parameters to C NFS, 116 preventing, 44 programs, 391-392 noclobber option, input and parameters and variables, passing parameters to output in, 159-161 41-79, 391-400 COBOL programs, nohup command, 230, 438, 544 aliases for data types in, 53 397-400, 397 Notepad, application arguments and, 41-42 passing parameters to Java development and, 433 arithmetic expansion in, programs, 392 null utility, exit status and, 83 76-78 passing parameters to RPG null values, parameters and programs, 392-397 variables, 55-56, 55 arithmetic expressions and, pattern modifiers and, number(?) prompt, 11 73-78, 64-66, numeric constants, 71-73 arrays in perl, 462-464, - perl utility and, variables in, O assigning variables, 209 462-464, - OCL, 33 child processes and, positional parameters in, od, 546, 556 exporting to, 222-223 42-43 CCSIDs and, 146-147 concatenating strings in, predefined variables in, Integrated File System (IFS) 70-71 56-58, - and, 134-135 data types, typed vs. preventing substitution in, 44 offset, parameters and untyped, 50-53 printf utility, 74, 76-77 variables, 66, 74 declare utility in, 50-53, 58 quotation marks in, weak vs. OLDPWD, 56 dollar sign parameters in, strong, 44, 46-48 Open Database Connectivity 45-49 read only variables in, 54 (ODBC), 535-541 dollar sign prefix in, 54-55 readonly utility and, 58 open files, 219 expansion of, variables, retrieving value of variables Open Group, 2 59-64 in, 54-55 Operations Navigator, 3 expansion operators for, scalar variables, 462 operators 59-60, , set utility and, 44, 72,

570 Index

shift utility in, 45-46, 48-49, Perl, application development file mode symbols in, 137, 74, 75 and, 434 - special parameters in, 46-49 perl utility, 437, 459-480 first permission byte in, substitution expansion arrays in, 462-464, - 143-144 expressions for, 67-69 ASCII and, 461 ls command and, 137, 138-139 substrings and, 66-67 backup files for, 473 multiple permission granting test utility, 74 benefits of, 459 in, 143 typeset utility in, 51-53, 58 chomp function in, 471 numeric values for absolute ulimit utility, 74 database access with, 478 syntax in, 142, unset utility in, 55-56 die or warn functions in, 479 Portable Application unshifting parameters in, downloads, distributions, Solutions Environment 48-49 modules for, 459 (PASE) and, 143 variable declaration in, examples of, 470-480 read, write, and execute in, 49-50 flags for functions in, 468-469 137, variables in, 49-55 functions in, 466-469, scripting and, 35 white space and, 43 - symbolic, 139-143 parent processes, 220 ILE version of, 460 symbols affecting users in PASE (See Portable Application interactive use of, 473 permission string, Solution Environment) iSeries Tools for Developers command in, 144-146 passing parameters to C and, 459, 460 Unix and, 144 programs, 391-392 lookup using, 473 user classification for, 138, passing parameters to COBOL match function in, 471 programs, 397-400 operators in, 465-466, pipes and pipelines, 217 passing parameters to Java - input and output in, 161-162 programs, 392 options for, 461-462, - perl utility and, 477 passing parameters to RPG pipes and pipelines in, 477 redirection, 162-163 programs, 392-397 Qshell commands run from, PkZip, 296, 495 PATH, 57 475 placeholder sequences in path name expansion (See also regular expressions in, 469, dspmg, 178, , 181 globbing) 257-266 - plus sign prompt, 11 globbing and, 257-263 resources for, 459 Portable Application Solution wildcards and, 257 running, 460-462 Environment (PASE), 143 path variable search and replace with, 470 application development commands and, 225-227 syntax of perl command in, and, 434 scripting and, 34-35 461, 462-470 ASCII data and, 436-438 paths, Integrated File System system utility and, 476, 478 CCSIDs and, 438 (IFS) and, 121-126 variables in, 462-464, - commands and, 207 pattern modifiers, 64-66, permissions, 137-146, , perl utility and, 437, 459-480 pattern space buffer, sed, 324 , 219 permissions and, 143 patterns, in case construct, abbreviations for, 140, QIBM_CCSID variable and, 110-111 absolute, 139-143 437 pax, 296-300, , 546, 556 changing, 139-143 touch utility and, 437 examples for, 299-300 chmod operators for, Virtual Network Computing options for, 297-299, 140-143, (VNC) and, 440-443, - file creation mask in, 144-146 portable archive (See pax utility)

571 Index

Portable utility and, 156-159 QIBM_QSH_INTERACTIVE_ Interface (POSIX) standard, processes, 219-224 CMD, 545 2, 3 child processes in, 220 QIBM_QSH_INTERACTIVE_ commands and, 208-209 exporting aliases to child TYPE, 545 positional parameters, 42-43 processes in, 224 QIBM_SYSTEM_ALWMLTT for loops and, 106 exporting variables to child HD, 545 pr, 548, 553, 556 processes in, 222-223 QIBM_USE_DESCRIPTOR_S Integrated File System (IFS) parent processes in, 220 TDIO, 378 and, 133-134 qsh command and, 220-221 QnetWare, 116 precautions, xv redirecting Qshell output QNTC, 116 precision characters for printf, and, 16 QOpenSys, 116 173, sh command and, 220-221 QOPT, 116 predefined variables, 56-58, subshells and, 220-221 qsh command, 220-221, 553 - profile file, scripting and, 37 QSH_REDIRECTION_CODE prestart jobs, redirecting Qshell Program Temporary Fix (PTF), PAGE, 549 output and, 18-20 417 QSH_REDIRECTION_TEXT print, 265, 266 programming (See writing DATA, 549 control character sequences programs for Qshell) QSH_USE_PRESTART_JOBS, for, 169 Programming Development 549 echo vs., 176 Manager (PDM), 402 QSH_VERSION, 549 exit status and, 82-83 prompt characters, 10, Qshell Interpreter, 4-5, , 16, file descriptors and, 189 PRPQ, 521 Qshell, 3-7 input and output using, 167, command, 18, 544 QSYS.LIB, 116 168-170, PS1/PS4 prompt characters, 11, globbing and, 262 sed, 341-342 57, 545 Integrated File System (IFS) pseudosignals, error handling, and, 121-124 printenv, 544 272 query and replace responses, ez printf command, 71-73, 170-175 , 555 editor utility and, 446, alignment of text using, PWD, 56 quit command, sed, 344-345 174-175 pwdx, 548, 555 quotation marks command substitution and, EDTF text editor and, 24-25 175 grep and, 311-313 control character sequences Q parameters and variables, for, 171 QCMD, 3 weak vs. strong, 44, conversion formatting QCMDEXC, 401 46-48 sequences for, 172-173, QDLS, 116 weak vs. strong quotes, 44 QFileServ.400, 116 QzshCheckShellCommand, formatting flag values in, QIBM_CCSID environment 549 173, variable, 437, 545 QZSHSH, 16 formatting sequences in, CCSIDs and, 148-149, QzshSystem, 549 171-172 - operators for, QIBM_QSH_CMD_ESCAPE_ parameters and variables, MSG, 545 R 74, 76-77 QIBM_QSH_CMD_OUTPUT RANDOM, 56 precision characters for, environment variable, 15, 545 RD, 557 173, commands and, 218-219 read command, 181-185,

572 Index

input and output in, 167, 168 Rfile utility, 417, 426-430, sample practice script in, 38-39 Internal Field Separators - , 544 script interpreters and, (IFS) in, 184 Integrated File System (IFS) 210-212 sed, 347-350 and, 133 special scripts in, 37 read-only variables, 54 , 11, 125, 548, 553, 556 stream files for, 33 readonly utility, parameters and , 117, 548, 554, 556 scripts, 21, 217 variables, 58 RMDIR, 557 sed, 323-358, 408, 546 read permission, 137, RMVDIR, 557 address command in, 327-328 Receive Data Queue RMVLNK, 558 append command in, 343-344 (QRCVDTAQ), 414 RNM, 558 buffers in, 324 Root file system, 116 redirecting Qshell output, change command and, 346-347 RPG programming, 359, 362-374 15-20, 155-159 commands in, 327-331 binding to C functions in, environment variables for, 15 delete command in, 332-334 362-364 file descriptors and, 193-195 examples for, 331-356 operators and pipes for, passing parameters to filter use of, 323 162-163 programs in, 392-397 forms of, syntax for, 325-326 overriding, 165-166 subprocedures and, 369-374 FTP application using, prestart jobs in, 18-20 Unix-type APIs in, 364-368 349-350 processes in, 16 RST, 558 functions and arguments in, stream files for, 16 running programs within 329-331, - terminal session for, 16-18 Qshell, 360-362 holding buffer in, 324, 325, redirection files, 219 running Qshell, 9-20 355-356 redirection operators, file input sources for, 324 descriptors and, 186-187, S insert command and, 343-344 SAV, 558 large files and, 324 regular expressions scalar variables, 462 Java and, 504 line-number function in, script interpreters, 210-212 351-352 perl utility and, 469, scripting, 33-39 list nonprinting characters - comments in, 36 command (l) in, 347 relative paths, Integrated File directory for, 33 metacharacters used with, System (IFS) and, 125-126 ENV environment variable 328, releases covered by book, xiv, in, 37 next command in, 352-354 543-549 executable commands in, options for, 326-327, remote use of sed, 323 36-37 Remove Directory Entries (See global profile in, 37 pattern matching in, 324 rm command) globbing metacharacters pattern space buffer in, 324 REN, 558 and, 259-262 print command in, 341-342 reserved words, 216, Integrated File System (IFS) quit command and, 344-345 retrieving value of variables, and, 33 read command in, 347-350 54-55 magic number in, 36 remote use of, 323 return utility, functions and, naming script files in, 34 script for, list of commands 253-254 PATH variable in, 34-35 as, 324, 356-358 rexec, 438, 544 permissions for, 35 sequential edits and, 324 , 544 profile file in, 37 source code generation and, REXX, 33 running script files in, 34-35 324

573 Index

sed, continued standard input (stdin) (See also syntax of commands, 208 substitute command in, standard files), 153, 359 system utility, 401-406 334-340, standard output (stdout), 154, 359 C and C++ programming, transform command and, 346 Start Qshell (STRQSH), 217 527 uses for, 323-324 Start Tools for Developers Java and, 503-504 write command in, 350-351 (STRPTL), 435 options for, 406, select construct, 107-110 status condition evaluation, test perl utility and, 476, 478 standard error device (stderr) utility and, 91-92, Programming Development output from, 107 stream files Manager (PDM) and, 402 Send Data Queue creation of, in EDTF, 29-30 spooled data and, 402-405, (QSNDDTAQ), 414 EDTF text editor and, 27-28 set utility, 44 input and output in, 153 system values, 409-410 input and output in, 160-161 redirecting Qshell output sysval utility, 409-410, 546 parameters and variables, and, 16 44, 72, revision of, in EDTF, 30-31 T setccsid, 147, 546, 557 scripting and, 33 , 548, 557 sh command, 220-221 string comparison, test utility tar, 285, 286-295, 544, 557 shift command, 101 and, 92-94, - ASCII and EBCDIC and, parameters and variables, strong quotes, 44 286 45-46, 48-49, 74, 75 style editor, ez editor utility CCSIDs and, 287 signals, 219, 270-273 and, 451-452 examples for, 289-295 simple commands, 217 subprocedures, RPG options for, 287-289, , 553 programming and, 369-374 - SlickEdit Visual SlickEdit, subshells, 220-221 restoring files from archive application development substitution, command, in, 293 and, 433 230-231, 236 symbolic links and, 291, 292 soft links sed, 334-340, updating files in archive in, icc utility and, 513 substitution expansion 294 Integrated File System (IFS) expressions, parameters and tee utility, 163-165, 548 and, 127, 131-132, variables, 67-69 template files, ez editor utility - substrings, parameters and and, 450-455, , sort command, 167, 554 variables, 66-67 terminal session source (dot) utility, 231-233, 544 switches, input and output in, 167 input and output in, 154 Source Entry Utility (SEU), 323 symbolic names, grep and, 307, interactive jobs and, 14, EDTF text editor and, 22-23 , 310, 311 test utility, 549 special parameters, 46-49 symbolic or soft links, 127, command line arguments functions and, 243 131-132 and, 201 , 548 Add Link (ADDLNK), 360 comparing arithmetic spooled data, 402-405, running programs within expressions and, 94-95, SQL, 421-423 Qshell, 360-362 comparing strings and, db2 utility and, 417-421 tar and, 291, 292 92-94, - standard error (stderr), 154, 359 Integrated File System (IFS) compound conditions and, case construct and, 107 and, 127, 131-132, 95-97, standard files, input and output - evaluating status conditions in, 153-154 symbolic permission, 139-143 in, 91-92,

574 Index

evaluating file conditions until loops, 100-102, 104 IFS file descriptor APIs and, 88-91, - usage function, 251-252 in, 381-383 exit status and, 87-97 user classification for newline character in, extended conditional in, 88 permissions, 138, 383-385 parameters and variables, 74 standard input/output Thinking in Java, 483 V functions in, 379-381 tilde expansion, 236 V4R3, 549 COBOL programming and, token separation, DOS vs. V4R4, 547-549 359, 374-377 Qshell, 552 V5R1, xiv, 546-547, -547 exit status and, 359 top-tested loops, 100, 104 V5R2, xiv, 543-546, - Java programming, 359, touch utility, 437, 548, 557 variables (See parameters and 386-390 CCSIDs and, 148 variables) option parameters in, tr utility, 156-159, 546 Virtual Network Computing 391-400 Transfer Control (TRFCTL), 235 (VNC), application passing parameters to C transform command, sed, 346 development and, 440-443, programs in, 391-392 trap utility, 270-280, 544 passing parameters to true utility, exit status and, 83 COBOL programs, type command, 207, 210, 544 W 397-400 typeset utility, 241-242, 245, 544 Wall, Larry, 459 passing parameters to parameters and variables, warn function, perl utility and, programs in, 392 51-53, 58 479 passing parameters to RPG , 546 programs, 392-397 U weak quotes, 44 RPG programming, 359, UDFS, 116 whence utility, 208, 210, 548 362-374 UID, 57, 545 while loops, 100-102, 104, 527 binding to C functions in, ulimit utility, 544 file descriptors and, 193 362-364 file descriptors and, 187 white space, in parameters and subprocedures and, parameters and variables, 74 variables, 43 369-374 umask, 557 wildcard characters, 257 Unix-type APIs in, permissions and, 144-146 case construct and, 110-111, 364-368 unalias utility, 214-215 running programs within , 544, 548 WinZip, 296, 495 Qshell, 360-362 uncompress utility, 300-303, word expansion, 235-236 standard error (stderr) in, 359 , 546, 557 Work with Active Jobs standard input (stdin) in, 359 undo capability, CKP files, 457 (WRKACTJOBS), 18 standard output (stdout) in, , 548 Work with User Jobs 359 University of California at (WRKUSRJOBS), 18 Unix-type APIs in, 364-368, Berkeley, 1 write command, sed, 350-351 374-377 Unix, 3 write permission, 137 WRKAUT, 559 APIs and, for RPG writing programs for Qshell, WRKLNK, 558 programming, 364-368 359-400 object based nature of C and C++ programming, X OS/400 vs., 401 359, 378-385 X Windows servers, 438-440 permissions and, 144 APIs available to, X/Open, 2 unset utility, 55-56, 242-243 378-379 xargs utility, 233-235, 266, 544

575 Index

XFree86 window manager, application development and, 435, 439 xtrace option, debugging and, 267-269

Z zcat utility, 302-303, 546, 557 zip, 285

576