#!/bin/sh # This is a shar archive. # The rest of this file is a shell script which will extract: # # 8_4a.c 8_4a.cmp 8_4b.c 8_4b.cmp 8_4c.c 8_4c.cmp 8_4d.c 8_4d.cmp 8_4e.c 8_4e.cmp 8_4f.c 8_4f.cmp 8_4g.c 8_4g.cmp 8_4h.c 8_4h.cmp 8_4i.c 8_4i.cmp makefile # # To extract the files from this shell archive file simply # create a directory for this file, move the archive file # to it and enter the command # # sh filename # # The files will be extracted automatically. # Note: Do not use csh. # # Archive created: Mon Jul 30 23:12:52 EDT 1990 # echo x - 8_4a.c sed 's/^X//' > 8_4a.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ // print all lower case letters, taking into // consideration non-English alphabets #include #include #include int main(int, char**) { for (int i = 0; i <= CHAR_MAX; i++) if (islower(i)) cout << chr(i); return 0; } !EOF! ls -l 8_4a.c echo x - 8_4a.cmp sed 's/^X//' > 8_4a.cmp << '!EOF!' !EOF! ls -l 8_4a.cmp echo x - 8_4b.c sed 's/^X//' > 8_4b.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ // print all letters, taking into // consideration non-English alphabets #include #include #include int main(int, char**) { for (int i = 0; i <= CHAR_MAX; i++) if (isalpha(i)) cout << chr(i); return 0; } !EOF! ls -l 8_4b.c echo x - 8_4b.cmp sed 's/^X//' > 8_4b.cmp << '!EOF!' !EOF! ls -l 8_4b.cmp echo x - 8_4c.c sed 's/^X//' > 8_4c.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ // print all letters and digits, taking into // consideration non-English alphabets #include #include #include int main(int, char**) { for (int i = 0; i <= CHAR_MAX; i++) if (isalnum(i)) cout << chr(i); return 0; } !EOF! ls -l 8_4c.c echo x - 8_4c.cmp sed 's/^X//' > 8_4c.cmp << '!EOF!' !EOF! ls -l 8_4c.cmp echo x - 8_4d.c sed 's/^X//' > 8_4d.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ // print all C++ Identifier characters, taking into // consideration non-English alphabets #include #include #include int main(int, char**) { for (int i = 0; i <= CHAR_MAX; i++) if (isalnum(i) || (i == '_')) cout << chr(i); return 0; } !EOF! ls -l 8_4d.c echo x - 8_4d.cmp sed 's/^X//' > 8_4d.cmp << '!EOF!' !EOF! ls -l 8_4d.cmp echo x - 8_4e.c sed 's/^X//' > 8_4e.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ // print all punctuation characters, taking into // consideration non-English alphabets #include #include #include int main(int, char**) { for (int i = 0; i <= CHAR_MAX; i++) if (ispunct(i)) cout << chr(i); return 0; } !EOF! ls -l 8_4e.c echo x - 8_4e.cmp sed 's/^X//' > 8_4e.cmp << '!EOF!' !EOF! ls -l 8_4e.cmp echo x - 8_4f.c sed 's/^X//' > 8_4f.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ // print all control characters, taking into // consideration non-English alphabets #include #include #include int main(int, char**) { for (int i = 0; i <= CHAR_MAX; i++) if (iscntrl(i)) cout << i << " "; return 0; } !EOF! ls -l 8_4f.c echo x - 8_4f.cmp sed 's/^X//' > 8_4f.cmp << '!EOF!' !EOF! ls -l 8_4f.cmp echo x - 8_4g.c sed 's/^X//' > 8_4g.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ // print all white space letters, taking into // consideration non-English alphabets #include #include #include int main(int, char**) { for (int i = 0; i <= CHAR_MAX; i++) if (isspace(i)) cout << chr(i); return 0; } !EOF! ls -l 8_4g.c echo x - 8_4g.cmp sed 's/^X//' > 8_4g.cmp << '!EOF!' !EOF! ls -l 8_4g.cmp echo x - 8_4h.c sed 's/^X//' > 8_4h.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ // print all white space letters, taking into // consideration non-English alphabets, in // integer format #include #include #include int main(int, char**) { for (int i = 0; i <= CHAR_MAX; i++) if (isspace(i)) cout << i << " "; return 0; } !EOF! ls -l 8_4h.c echo x - 8_4h.cmp sed 's/^X//' > 8_4h.cmp << '!EOF!' !EOF! ls -l 8_4h.cmp echo x - 8_4i.c sed 's/^X//' > 8_4i.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ // print all printable characters, taking into // consideration non-English alphabets #include #include #include int main(int, char**) { for (int i = 0; i <= CHAR_MAX; i++) if (isprint(i)) cout << i << " "; return 0; } !EOF! ls -l 8_4i.c echo x - 8_4i.cmp sed 's/^X//' > 8_4i.cmp << '!EOF!' !EOF! ls -l 8_4i.cmp echo x - makefile sed 's/^X//' > makefile << '!EOF!' CC= CC -I. -I../../CC all: 8_4a 8_4b 8_4c 8_4d 8_4e 8_4f 8_4g 8_4h 8_4i 8_4a: 8_4a.c $(CC) 8_4a.c -o 8_4a 8_4b: 8_4b.c $(CC) 8_4b.c -o 8_4b 8_4c: 8_4c.c $(CC) 8_4c.c -o 8_4c 8_4d: 8_4d.c $(CC) 8_4d.c -o 8_4d 8_4e: 8_4e.c $(CC) 8_4e.c -o 8_4e 8_4f: 8_4f.c $(CC) 8_4f.c -o 8_4f 8_4g: 8_4g.c $(CC) 8_4g.c -o 8_4g 8_4h: 8_4h.c $(CC) 8_4h.c -o 8_4h 8_4i: 8_4i.c $(CC) 8_4i.c -o 8_4i CMP= 8_4a.cmp 8_4b.cmp 8_4c.cmp 8_4d.cmp 8_4e.cmp 8_4f.cmp 8_4g.cmp 8_4h.cmp 8_4i.cmp OUT= 8_4a.out 8_4b.out 8_4c.out 8_4d.out 8_4e.out 8_4f.out 8_4g.out 8_4h.out 8_4i.out 8_4a.out: 8_4a ; 8_4a > 8_4a.out 8_4b.out: 8_4b ; 8_4b > 8_4b.out 8_4c.out: 8_4c ; 8_4c > 8_4c.out 8_4d.out: 8_4d ; 8_4d > 8_4d.out 8_4e.out: 8_4e ; 8_4e > 8_4e.out 8_4f.out: 8_4f ; 8_4f > 8_4f.out 8_4g.out: 8_4g ; 8_4g > 8_4g.out 8_4h.out: 8_4h ; 8_4h > 8_4h.out 8_4i.out: 8_4i ; 8_4i > 8_4i.out test: all $(OUT) $(CMP) cmp 8_4a.out 8_4a.cmp cmp 8_4b.out 8_4b.cmp cmp 8_4c.out 8_4c.cmp cmp 8_4d.out 8_4d.cmp cmp 8_4e.out 8_4e.cmp cmp 8_4f.out 8_4f.cmp cmp 8_4g.out 8_4g.cmp cmp 8_4h.out 8_4h.cmp cmp 8_4i.out 8_4i.cmp @echo test done !EOF! ls -l makefile # The following exit is to ensure that extra garbage # after the end of the shar file will be ignored. exit 0