UNIX ?? - PowerPoint PPT Presentation

About This Presentation
Title:

UNIX ??

Description:

UNIX 1. UNIX 2. 3. vi 4. Shell I 5. Shell II 6. Process Control 7. Shell Programming I 8. – PowerPoint PPT presentation

Number of Views:62
Avg rating:3.0/5.0
Slides: 162
Provided by: 6649212
Category:

less

Transcript and Presenter's Notes

Title: UNIX ??


1
UNIX ??
  • ???

2
??
  • 1. UNIX ??? ??
  • 2. ?? ??
  • 3. vi ??? ??
  • 4. Shell I
  • 5. Shell II
  • 6. Process Control
  • 7. Shell Programming I
  • 8. Shell Programming II
  • 9. ??? ?? ??

3
1. UNIX ??? ??
  • ? ?
  • 1. UNIX? ??? ????.
  • 2. Login ? Logout? ? ? ??.
  • 3. UNIX ??? ??? ????.
  • 4. ??? ???? ??? ? ??.
  • 5. ???? ????? ??? ? ??.

4
UNIX ??
  • ????
  • UNIX ????
  • ??? ??? ?? ?? (Multi-tasking)
  • ?? ??? ?? (Multi-user)
  • ?? ???? ???

5
UNIX ?? (??)
6
Logging In and Out
  • login user1 Login
  • Password
  • Login message
  • date Do work
  • other commands
  • exit or ltCtrlgtd Log out

7
Command Line ??
  • ??
  • command -option argument
  • ?
  • date
  • Wed Mar 31 203332 JST 1999
  • ls
  • dira dirb f1 f2 prog1 prog2
  • ls -F
  • dira/ dirb/ f1 f2 prog1 prog2

8
Online ???
  • ??
  • man -X command
  • X Manual Page Section number
  • Section ??? ?? (HP-UX)
  • ?
  • man date
  • man passwd
  • man 4 passwd

1User Commands 1mSystem Maintenance Commands
(Section 8) 2System Calls 3Functions and
Function Libraries
4File Formats 5Miscellaneous Topics 7Device
(Special) Files 9Glossary
9
?? ??? (I)
  • id ??? ID ? ?? ID ??
  • id
  • uid601(user1) gid600(class)
  • w ??? botting ??, load, login ??? ??(??)??
  • w
  • 900pm up 8 days, 731, 4 users, load
    average 0.08, 0.03, 0.02
  • User tty login_at_ idle JCPU
    PCPU what
  • root console 246pm 12904
    -sh
  • user3 pts/0 259pm
    w
  • who ?? login ? ??? ?? ??
  • root console Mar 24 1446
  • user3 pts/0 Mar 31 1459
  • who am i Local ???? ??? ??? ?? ??
  • user3 pts/0 Mar 31 1456

10
?? ??? (II)
  • date ??? ??? ??? ??
  • date
  • Fri Mar 26 145742 JST 1999
  • passwd Login Passwd ??
  • passwd
  • Changing password for user1
  • Old password
  • New password
  • Re-enter new password

11
?? ??? (III)
  • hostname ???? ??? ??
  • hostname
  • ich01
  • uname ???? ??? ????? ?? ?? ??
  • uname -a
  • HP-UX ich01 B.10.20 U 9000/869 1426594321
    unlimited-user license
  • echo ??? ??
  • echo how are you
  • how are you
  • banner ? ??? ??
  • banner hi!

12
?? ??? (IV)
  • write login ?? ?? user? terminal ? ???? ??
  • write user2 tty0p4
  • Hi ltReturngt
  • Nice to meet you! ltReturngt
  • ltCtrlgtd
  • mesg ??? ?? ??/?? ??
  • mesg
  • is y
  • mesg n
  • mesg
  • is n
  • mail mail ??
  • mail user1 user1 ?? ??? ??
  • see you again ltCtrlgt d
  • mail ?? ??? ??

13
?? ??? (IV)
  • mail ??

14
2. ????
  • File System Hierarchy
  • File System ?? ???
  • ???? ???
  • ?? ??/??

15
File System Hierarchy
16
???? .vs. ???? (1)
  • ????
  • ???? ????? ??? ???? ??
  • ????? ? ?(??)?? ?? ( / ? ??)
  • ????? ????/???????? ???
  • ????
  • ????? ?????? ?? ( / ? ???? ??)
  • ????? ???? ??
  • ??????
  • ??? ????(? ????) ??? ???? ???? ????
  • Dot (.) ?? ????
  • Dot Dot (..) ?? ???? ?? ?? ?? ????

17
???? .vs. ???? (2)
18
File System ?? ???
  • pwd ?? ????? ???? ??
  • ls ?????? ??/???? ?? ??
  • cd ???? ??
  • find ??? ??
  • mkdir ???? ??
  • rmdir ???? ??

19
File System ?? ??? I
  • ls dir ????? ??? ?? (List Contents of a
    Directory)
  • -a ?(.)?? ???? ?? ???? ?? ?? ??
  • -d ???? ?? ??
  • -l ??, ??, ???, ???, ??, ?? (byte), ???, ??
  • -F ?????? ?? (/) ??, ???? ???? ??
  • -R ???????? ????? ??
  • ?
  • ls
  • f1 f2 memo
  • ls -F
  • f1 f2 memo/
  • ls -aF
  • ./ .exrc .profile f1
    memo/
  • ../ .login .sh_history f2
  • ls -F /home
  • user1/ user2/ user3/

20
File System ?? ??? II
  • pwd ?? ?? ????? ??(Present Working Directory)
  • pwd
  • /home/user1
  • cd ???? ?? (Change Directory)
  • pwd
  • /home/user3
  • cd memo pwd
  • /home/user3/memo
  • cd ../../ pwd
  • /home
  • cd /tmp pwd
  • /tmp
  • cd pwd
  • /home/user3

21
File System ?? ??? III
  • find ??? ??
  • ?? find start_dir -name filename start_dir ??
    ???? ?? ??? filename ? ??? ???.
  • start_dir ???? ??. ?? ????? ????? ??
  • ?
  • find . -name .profile
  • ./.profile
  • find / -name f1
  • /home/user3/memo/f1
  • /home/user3/f1
  • find . -name core

22
File System ?? ??? IV
  • mkdir, rmdir ????? ??, ????? ??
  • ?? mkdir -p dir_pathname(s) ????? ??
  • -p ??????? ?? ?? ??
  • rmdir dir_pathname(s) ????? ???
  • ?
  • lsf
  • f1 f2 memo/
  • mkdir fruits/apple
  • mkdir cannot access fruits No such file or
    directory
  • mkdir -p fruits/apple
  • rmdir fruits
  • rmdir fruits Directory not empty
  • rmdir fruits/apple fruits

23
File ? ??
  • Regular Files (????)
  • 1. ???, ???, ???? ?? ??
  • 2. ls, man, date ?? ????? ????
  • Directories (????)
  • ?? ?? ??, ???? ??, ????? ID ? ??? ?? ?? ???
  • Device Files (????)
  • ???, ???, ??? ?? ???? ??? ?? ?????? ???? ?? ???

24
File ??
  • ls -l
  • -rw-r--r-- 1 user3 class
    44 Mar 26 1621 f1
  • -rwxr-xr-x 1 user3 class 67
    Mar 26 1622 f2
  • drwxrwxrwx 2 user3 class 1024 Mar
    26 1612 memo

????
???
??
??
??
Time Stamp
???
Permissions
25
?? ?? ???
  • ls ?? ?? ??
  • cat ?? ?? ??
  • more ?? ??? ? ??? ??? ??
  • tail ??? ?? ??
  • cp ?? ??
  • mv ??/???? ?? ??. ?? ??
  • rm ?? ??
  • diff ???? ??? ???
  • ln ??? ????

26
cat ???
  • ??
  • cat file file ??? ??? ???
  • ?
  • cat f1
  • Test file!
  • cat f2
  • Test file, too!
  • cat f1 f2
  • Test file!
  • Test file, too!
  • ??? ?????
  • cat gt filename ltEntergt
  • This is test file
  • ..
  • ltCtrlgt d

27
more ???
  • ??
  • more filename ??? ??? ??? ??? ???
  • ?????
  • f, ltCtrlgtf, ltspacegt ?? ? ??? ??? ???
  • b, ltCtrlgtb ?? ? ??? ??? ???
  • q, Q ?? ??? ???
  • v ???? ??? ??
  • h help
  • ?
  • more longfile
  • The find command recursively descends the
    directory hierarchy for each
  • path name in pathname_list (that is, one or
    more path names) seeking
  • files that match a Boolean expression
    written in the primaries given
  • below. By default, find does not follow
    symbolic links

longfile (5)
28
head, tail ???
  • ??
  • head -n number filename ??? ?? number ?? ???
    (default 10)
  • tail -n number filename ??? ??? number ??
    ??? (default 10)
  • tail -f -n number filename -f Follow
    Option.
  • ?
  • head -n 10 longfile ( head longfile )
  • tail -n 10 longfile ( tail longfile )
  • tail -f longfile
  • ..
  • ltCtrlgt C

29
cp ???
  • ??
  • cp -i file1 new_file ??? ?? ???? ???
  • cp -i file file dest_dir ??(?)? ??
    ??????? ???
  • cp -r -i dir dir dest_dir ????? ?? ?????
    ??? ? ? ?? ???? ??? ???
  • -i ??? option.
  • -r ??? option .
  • ?
  • ls -F
  • f1 f2 memo/ note remind
  • cp f1 f1.copy
  • ls -F
  • f1 f1.copy f2 memo/ note remind
  • cp note remind memo
  • ls -F memo
  • note remind

30
mv ???
  • ??
  • mv -i file1 new_file ??? ??? ??
  • mv -i file file dest_dir ??(?)? ?? ????
    ??? ??
  • mv -i dir dir dest_dir ???? ??? ?? ?? ??
    ???? ? ?? ??
  • -i ??? option.
  • ?
  • ls -F
  • f1 f2 memo/ note remind
  • mv f1 file1
  • ls -F
  • file1 f2 memo/ note remind
  • mv f2 memo/file2
  • ls -F
  • file1 memo/ note remind
  • ls -F memo
  • file2

31
rm ???
  • ??
  • rm -if filename filename .. ??? ???
  • rm -r -if filename filename .. ????? ???
  • ?
  • ls -F
  • f1 f2 fruits/ memo/
  • rm f1 ls -F
  • f2 fruits/ memo/
  • rm -i f2
  • f2 ? (y/n) y
  • rm fruits
  • rm fruits directory
  • rm -r fruits

32
diff ???
  • ??
  • diff -i file1 file2 ??? ??? ???
  • -i ????? ???
  • ?

cat fruit1 I like fruits apple orange
cat fruit2 I like fruits apple orange grapes mel
on
cat fruit3 I like fruits very
much apple strawberry
diff fruit1 fruit3 1c1 lt I like fruits --- gt I
like fruits very much 3c3 lt orange --- gt
strawberry
diff fruit1 fruit2 3a4,5 gt grapes gt melon
33
ln ???
  • ??
  • ln file new_file Link to a file
  • ln file file dest_dir Link files to a
    directory
  • ?
  • ls -l f1
  • -rw-r--r-- 1 user3 class 44 Mar
    26 1621 f1
  • ln f1 /home/user2/f1.link
  • ls -l f1
  • -rw-r--r-- 2 user3 class 44 Mar
    26 1621 f1
  • ls -l /home/user2
  • -rw-r--r-- 2 user3 class 44 Mar
    26 1621 f1.link
  • ls -i f1 /home/user2/f1.link
  • 97852 /home/user2/f1.link 97852 f1


34
ln ??? (Hard Link)
  • ??
  • ln file new_file Link to a file
  • ln file file dest_dir Link files to a
    directory
  • ?
  • ls -l f1
  • -rw-r--r-- 1 user3 class 44 Mar
    26 1621 f1
  • ln f1 /home/user2/f1.link
  • ls -l f1
  • -rw-r--r-- 2 user3 class 44 Mar
    26 1621 f1
  • ls -l /home/user2
  • -rw-r--r-- 2 user3 class 44 Mar
    26 1621 f1.link
  • ls -i f1 /home/user2/f1.link
  • 97852 /home/user2/f1.link 97852 f1


35
?? ??? ??
  • UNIX ???? ?? Access ??
  • user(???) ??? ???
  • group(??) ??? ????? ?? ??
  • other(??) ????? ?? ?? ???
  • Access ?? read, write, execute

36
?? ??? ?? (?)
  • ls -l
  • - rw- r-- r-- 1 user3 class 32
    Mar 26 2208 f1
  • - rwxr-x r-x 1 user3 class 52
    Mar 26 2209 f2
  • drwxr-x r-x 2 user3 class 1024
    Mar 26 2107 memo

???
??
??
37
??? ?? ?? ???
  • chmod ?? ?? ?? ??
  • umask ?? ?? ?? ?? ??
  • chown ??? ??? ??
  • chgrp ??? ?? ??
  • su user identifier ??
  • newgrp group identifier ??

38
chmod
  • ??
  • chmod mode_list filename ... ??? ?? ?? ??
  • mode_list who operator permission ,
  • who user, group, other, or all
  • operator (add), -(subtract), (set equal to)
  • permission read, write,execute
  • chmod numeric_mode filename ??? ?? ?? ??
  • numeric_mode ??????? ????
  • ??
  • Orginal Permission mode user group other
  • rw-r--r-- rw- r-- r--
  • New Permission rwxr-xr-x rwx r-x r-x
  • chmod ux, gx, ox file or chmod x
    file or chmod 755 file

39
umask - ?? ?? ?? ???? ??
  • ??
  • umask ?? ???? ?? ??? ? ??
  • umask mode ???? ?? ??? ? ??
  • ??
  • user group other
  • default permissions r w - r w - r w -
  • set default permissions r w - r - - - - -
  • umask g-w,o-rw
  • umask 026

40
chown, chgrp
  • ??
  • chown -R owner filename ?? ???? ??
  • chown -R ownergroup filename ???? ??? ?? ??
  • chgrp -R group filename ?? ??
  • ??
  • ls -l f1
  • -rw-r--r-- 1 user3 class 32 Mar
    26 2208 f1
  • -rwxr-xr-x 1 user3 class 52 Mar
    26 2209 f2
  • chgrp users f1
  • ls -l f1
  • -rw-r--r-- 1 user3 users 32 Mar
    26 2208 f1
  • chown user2 f1
  • ls -l f1
  • -rw-r--r-- 1 user2 users 32 Mar
    26 2208 f1
  • chown user3users f2
  • ls -l f2
  • -rwxr-xr-x 1 user3 users 52 Mar
    26 2209 f2

41
su - Switch User ID
  • ??
  • su user_name user ID ? group ID ? ??
  • su ???? root ? ??
  • ??
  • id
  • uid603(user3) gid600(class)
  • su user2
  • Password
  • id
  • uid602(user2) gid600(class)
  • ...
  • exit or ltCtrldgt
  • id
  • uid603(user3) gid600(class)

42
Remote ??? Access ?? ??
  • rlogin ?? Login
  • telnet ?? ??
  • ftp ????????? ??? ?? ??

43
telnet
  • ??
  • telnet hostname hostname ?? ??????.
  • telnet ip_address ip_address? ??????.
  • ??
  • telnet alpha2 or telnet 105.20.19.210
  • Trying...
  • Connected to alpha2.
  • Escape character is ''.
  • Local flow control on
  • Telnet TERMINAL-SPEED option ON
  • HP-UX alpha2 B.10.20 C 9000/887 (ttyp4)
  • login yuhwa
  • Password
  • alpha2/user3/yuhwa

44
rlogin
  • ??
  • rlogin hostname -l username hostname ??
    ??????.
  • -l username ?? username?? ??????. default ?
    ????? id
  • ??
  • rlogin alpha2 -l yuhwa or rlogin
    150.20.19.210 -l yuhwa
  • Password
  • alpha2/user3/yuhwa

45
ftp - file transfer program
  • ??
  • ftp hostname (hostname ??) ???? ????
  • ftp ??
  • ftpgt ! command ??????? command ??
  • ftpgt bye ?? ??? ?? ftp ??
  • ftpgt open hostname hostname ??? ???? ??? ??
  • ftpgt close ??? ??? ??
  • ftpgt get remotefile localfile ??????
    remotefile? localfile??? ???? ??(???? ?? ????
    ??). mgetgt multi-file get
  • ftpgt put localfile remotefile ?????? localfile
    ? ?????? remotefile ??? ???? ??gt multi-file put
  • ftpgt bin Binary ??? ??? ??
  • ftpgt asc ASCII ??? ??? ??
  • ftpgt prompt Interactive ?? ??
  • ftpgt help command (command? ??) help

46
3. vi ??? ??
  • vi ??
  • ?? Command

47
vi ??
  • ??? ?? ??? (full screen editor)
  • - UNIX ??? ??? ???? ?? ?? ???
  • - ??? ???? ??? ? ??? ?? ??? ?? ????
  • - ??? ??? ???? ?? ??? ??? ? ??
  • - ?? ???? UNIX ????? ??
  • ??? ???? ????
  • - ????? ???? ?????? ???? ??? ?? ???.
  • - ???? ?? ???? ?? ??? ??? ???? ??
  • export TERMansi
  • resize
  • - vi ? ????? ??? ?? ??? ?? ltCtrlgtq
  • - vi ??? ??? ??? ?? ltCtrlgt l
  • - vi ? ??? ?? ??
  • vi -r filename

48
vi ????
  • ??
  • vi filename ???? ?? ??? ??? ???
  • vi -R filename (cf. view) ??? Read Only ??? ??
  • vi -r filename ??? ?? ?? ??
  • ?
  • vi sample_file

49
vi modes
  • Command Mode keystrokes ? command ? ??
  • Input Mode keystrokes ? ??? ???
  • Last Line Mode ex command? ??

/ ?
a i o A I O
Command Mode
Last Line Mode (ex)
return
esc
50
vi Session
This is Sample Text file.
?? ??
????

?? ??? ?? ?? ???(?????? ??)
ex commands mode message
or vi ??? ???
51
vi ???
  • vi ???
  • ltescgt ZZ ??? ???? ?? (???? ????)
  • ltescgt wq ltReturngt ??? ???? ??
  • ltescgt q! ltReturngt ??? ???? ?? ??
  • ltescgt q ltReturngt ??? ???? ?? ??

Memory
trash can
sample_file
Disk
ltescgt q! ltReturngt
ltescgt wq ltReturngt
sample_file
52
Command Mode - Cursor Control
  • ???/?? ??? ??
  • - ???(?, ? , ?, ?,)
  • - h, backspace(?), j (?), k (?), l (?)
  • ?? ??? ??
  • - w ???? ?? ??, W space ? ??? ??
  • - b ???? ?? ??, B space ? ??? ??
  • - e ?? ??? ??? ??
  • ? ??? ??
  • - , 0 ?? ?? ???? ??
  • - ?? ?? ??? ??
  • - G ??? ??
  • - return ????? ??? ?? ???? ??

53
Command Mode - Cursor Control
  • ????? ??
  • - ctrlb ??? ?? ??,
  • - ctrlf ??? ??? ??
  • - ctrlu ??? ?? ??
  • - ctrld ??? ??? ??
  • - H ? ??? ?? ??? ??
  • - M ? ??? ???? ??
  • - L ? ??? ??? ?? ??
  • ?? ???
  • ctrll ??? ?? ???.
  • ctrlq vi ? ????? ??? ?? ??? ??

54
Command Mode - ??/??/??
  • ??
  • - u ??? ?? ??? ??
  • - U ??? ????? ???? ???? ??? ?? ??
  • ??
  • - x ?? ??? ??? ?? ??
  • - dw ??? ??
  • - dd ???? ?? ??
  • - d ??? ?? ???? ?? ??? ??
  • - dG ?? ???? ??? ????? ?? ??
  • ??
  • - r ?? ??? ??? ??? ??
  • - cw ?? ?? ??
  • - cc ??? ?? ??
  • - cG ??? ?? ???? ?? ??? ??
  • - R ltescgt ? ?? ??? ?? ??? ??

55
Command Mode - Copy Paste
  • ??
  • - yw ?? ?? ??
  • - yy ??? ??
  • - yG ?????? ??? ??? ??? ??
  • - y ?? ??? ??
  • ???
  • - p ????? ??? ?? ?? ??? ??
  • - p ????? ??? ?? ?? ??? ??
  • ??
  • - . ?? ?? ??
  • - J ??? ???.
  • - ctrlG ???? (????, ?????, ?????, ??) ??
  • - ???? ??

56
Input Mode ???
  • Insert
  • - i ?? ?? ????? ??
  • - I ?? ??? ?? ?? ???? ??
  • Append
  • - a ?? ?? ?? ????? ??
  • - A ?? ??? ?? ?? ????? ??
  • Open
  • - o ?? ??? ?? ????? ??
  • - O ?? ??? ?? ???? ??

57
?? ??? ??
  • ?? ???
  • /text ??? ?? ???? ??? ????? ??? ??
  • ?text ??? ?? ???? ??? ?? ???? ??? ??
  • n ??? ?? ??? ?? ??? ?? ???? ??
  • N ??? ?? ??? ?? ??? ?? ???? ??
  • ??? ?? (???. Regular Expression)
  • oOld_text old_text , Old_text
  • text ?? ??? ??? text
  • text ?? ?? ??? text
  • . ????? ??? ??
  • character 0? ??? ?? ??

58
ex ??? - ?? ??? ??
  • m,ns/old_pattern/new_pattern/option
  • m, n ??? ??? ??? ?? ??. ?? ???? ??? ?? ??? ??
    ??? ??? ??
  • s ?? ???(substitute)
  • old_pattern ??? ???(Regular Expression)
  • new_pattern ?? ???
  • option g - ?? ??? ?? ??
  • c - ??? ????? ???
  • ???? ???? ?? ?? ??? ???? ??

59
ex ???
  • w ????? ???? ??
  • m,nw file m?? ??? n?? ??? file? ??
  • w file ????? ????? file ? ??
  • w! file ??? ??? ?? (??? ?? ?)
  • e file file ? ???? ?? ??? ??
  • e! ????? ????? ???? ?? ??
  • e ?? ??? ????? ??
  • r file file ? ??? ?? ????? ????
  • ! command shell command ? ??
  • set option vi ??? ???
  • set nooption vi ????? ???
  • set all vi ?? ?? option? ?? ???

60
4. Shell I
  • ??
  • ?? Command

61
Shell ??
  • Shell ???
  • - ???? login ? ???? ?, ??? ??? ?? ??loop ????
  • Shell ? ??
  • - ??? ?????? ??? ?????.
  • - ??? ???? ???? ????.
  • - ??? ???? ??? ?? child process? ???? ?? ????
    ???? ??? ?? ?? ?? ???? ????.

whlie (True) printf (prompt ) gets
(str) execvp (str, NULL)
62
Shell ??
Users
Shell
environment settings
command execution
Kernel
environment settings
pipelines
Hardware
variable assignment
I/O redirection
variable substitution
filename generation
command substitution
63
Shell ??
64
Korn Shell ??
  • Command Alias
  • File name completion
  • Command History
  • Re-entering command
  • Recalling command
  • Command line editing

65
Aliasing
  • ??
  • alias ?? ??? ?? alias ? ??
  • alias name name ? ??? alias ??
  • alias namestring string ? name ?? ??? alias ? ??
  • ??
  • alias dir'ls -F'
  • dir
  • f1 f2 f3 memo/ test/
  • alias dir
  • dirls -F
  • alias copycp
  • alias del'rm -i'

66
File Name Completion
  • ls -l
  • -rw-r--r-- 1 user3 class 32 Mar
    26 2208 f1
  • -rwxr-xr-x 1 user3 class 52 Mar
    26 2209 f2
  • -rw-rw-rw- 1 user3 class 32 Mar
    27 1947 f3
  • -rw-rw-rw- 1 user3 class 23 Mar
    27 2205 sample.txt
  • cat sa ltescgt ltescgt
  • cat sample.txt ltReturngt
  • ...
  • cat f ltescgt ltescgt
  • cat f ltescgt
  • 1) f1
  • 2) f2
  • 3) f3
  • cat f ltagt1
  • ...


67
Command History Re-entering
  • ??
  • history -n ??? ?? n ?? ??? ??. ??? 16?
  • history a z a???? z????? ??? ??
  • r c c?? ??? ???? ?? ?? ??? ??? ? ?? ??? ???
    ????
  • ??
  • history -2
  • 172 cat sample.txt
  • 173 cat f1
  • r 173
  • cat f1
  • ...
  • r c
  • cat f1
  • ...

68
Recalling Command Line Editing
  • Recalling Commands
  • Prompt ?? ltescgt ? ???
  • gt ?? vi ??? ???
  • vi ???? ???? ??? ???? ????? ?????.
  • k ???? ?? ???? ??
  • j ???? ?? ???? ??
  • nG n?? ???? ??
  • ltentergt ? ??? ?? ???? ????.
  • Command Line Editing
  • ltescgt ? ??? command ??? ????.
  • vi command ? ???? line ? ????.
  • ltentergt ? ??? ??? ???? ????.

69
??? ??
  • ????
  • HOME ? ????? ?? ?? ??
  • PATH ??? ???? ?? ??
  • TERM, COLUMN, LINES ???? ??? ??
  • LOGNAME ?????? ??? ??? ??
  • HISTFILE ?? ??? ??
  • EDITOR Command Line Editor ??
  • ?? ??
  • env
  • PATH/usr/bin/usr/contrib/bin/
  • COLUMNS80
  • EDITORvi
  • LOGNAMEuser3
  • HOME/home/user3
  • TERMansi
  • LINES29

70
??? ?? ??
  • Shell ?? ?? ??
  • ??
  • namevalue ??? ???? ??? ?
  • ?
  • TERMansi
  • ?? ?? ??
  • PATH ?? ??? ???? ?? ?? ???? ??
  • PATH/usr/bin/usr/contrib/bin/usr/local/bin
  • TERM ???? ??? ??
  • TERMvt100
  • PS1 Shell Prompt String ??
  • PS1PWD !
  • PS1hostname'PWD'

71
login ??
  • displays the contents of /etc/issue
  • issues the login prompt
  • runs login

getty
kernel
  • validates user name and password
  • places user in home directory
  • runs the users shell

login
  • executes /etc/profile
  • executes .profile
  • issues the shell prompt

/usr/bin/ksh
72
login ??
  • displays the contents of /etc/issue
  • issues the login prompt
  • runs login

getty
kernel
  • validates user name and password
  • places user in home directory
  • runs the users shell

login
  • executes /etc/profile
  • executes .profile
  • issues the shell prompt

/usr/bin/ksh
73
Shell ??? ??
  • ???? (local variable)
  • ?? ??? ??? ???
  • ?? ??? ????? ?? ?? ????? ?? ???? ??
  • export ???? ??? ?? ??? ???? ??? ? ??
  • ???? (environment variable)
  • ?? ??? ??? ??
  • ?? ????? ?? ??? ? ??

74
Display Variable Values
  • echo HOME
  • /home/user3
  • env
  • PATH/usr/bin/usr/contrib/bin/usr/local/bin/hom
    e/user3.
  • HOME/home/user3
  • TERMansi
  • set
  • PATH/usr/bin/usr/contrib/bin/usr/local/bin/hom
    e/user3.
  • HOME/home/user3
  • TERMansi
  • dir_namememo/fruits
  • file1this
  • file2that
  • my_lsls -aFC


75
Variable Substitution
  • ??
  • name ?? ??? ??? ??? ???
  • ?
  • echo PATH
  • /usr/bin/usr/contrib/bin/usr/local/bin
  • PATHPATHHOME. echo PATH
  • /usr/bin/usr/contrib/bin/usr/local/bin/home/use
    r3.
  • dir_namememo/fruits echo dir_name
  • memo/fruits
  • ls -F dir_name
  • apple orange test/
  • my_ls"ls -aFC"
  • my_ls dir_name
  • ./ ../ apple orange test/


76
Command Substitution
  • ??
  • (command) ??? ???? ??? ??
  • command
  • ?
  • pwd
  • /home/user3
  • curdir(pwd)
  • echo curdir
  • /home/user3
  • cd /tmp
  • pwd
  • /tmp
  • cd curdir
  • pwd
  • /home/user3

77
Tilde Substitution
  • ??? ??()? ???? ?? ??? ???
  • ?
  • ?? / HOME ??? ????? ??
  • userid ?? userid ? ? ????
  • PWD ??? ??
  • - OLDPWD ??? ??

78
File Name Generation
  • File Name Generating Characters
  • ? ??? ?? ??? ?? (?? ?? . ??)
  • ?? ??? ???? ???? ??? ??
  • - ?????? ?? ??? ??
  • ! ?? ???? negate
  • 0? ??? ??? ?? (?? ?? . ??)
  • ?
  • ls -a
  • . .. .zz 1G 2G 7G 15G Ant Cat Dog
    abc abcdef cyz
  • echo abc?? gt echo abc cyz
  • echo 1-9A-Z gt echo 1G 2G 7G
  • echo !A-Z?? gt echo 15G abc cyz

79
Quoting
  • ??? ??? Shell ??? ??? ??? ???? ?
  • Quoting Character
  • backslash (\) ?? ??? ??? ??? ???
  • single quotes () ?? ???? ?? ?? ????? ??? ???
    ? ??
  • double quotes () ? ???? ?? ????? ???? ???.
  • ?? \, , ????, (???)
  • Shell ??? ?? ??
  • White space ???
  • ??
  • ????

80
5. Shell II
  • I/O Redirection
  • Filter
  • Pipe

81
stdin, stdout, stderr
File
Device
stdin
stdout
stderr
82
Redirection
  • ?? ???? ??? ??? ??? overwrite ?
  • C Shell ??? ????? gt ?. cp gt cp.err

83
Filter
  • ??
  • ???????? ??? ?? ?????? ??? ????
  • ???? ??? ???? ?? ??? ???? ???.
  • ?? ???? ???? ??? ???? ? ??.
  • ?
  • wc Word Count
  • sort Alphabetical or Numerical Sort
  • grep Pattern Matching

84
wc
  • ??
  • wc -lwc file ???? ?, ??, ???? ??.
  • -l ???
  • -w ???
  • -c ???
  • ?
  • cat f3
  • This is Sample file
  • wc f3
  • 1 4 20 f3
  • wc -l f3
  • 1 f3

85
sort
  • ??
  • sort -ndutx -k field_no file ??? line
    ? sort
  • -n ??? sort
  • -u ???? sort. ???? ?? ??
  • -tcharacter ?? ??? character ??. default? ?? ??
    ?
  • -k field_no ?????? ?? ?? ?? (default ? ?? line)
  • -r Reverse order ? ??
  • -M ??? ???? ??
  • ?
  • tail -1 /etc/passwd
  • user3p88gQZpB3S/Fg603600,,,/home/user3/usr/b
    in/ksh
  • 1 2 3 4 5 6 7
  • sort -nt -k 3 /etc/passwd

86
grep
  • ??
  • grep -cinv patterns file file ?? patterns
    ? ???.
  • grep -cinv -f pattern_file file
  • -c ???? ??? ?? ????.
  • -i ???? ??? ????? ???? ???.
  • -v ??? ???? ?? ?? ??
  • -n ??? ? ?? ? ??? ??
  • -f ??? ??? ?? ??
  • -e ??? 2? ??? ?? ??
  • ?
  • grep user /etc/passwd
  • user2N8aQNxXWCNcJg602600,,,/home/user2/usr/b
    in/ksh
  • user3p88gQZpB3S/Fg603600,,,/home/user3/usr/b
    in/ksh
  • grep -v user /etc/passwd
  • grep -i user /etc/passwd
  • grep user /etc/passwd

87
????? (Regular Expression)
  • Regular Expression ??? ???? ??? ???? ?? ?? ???
    ???? ???? ?? ?? (pattern description)

88
pipe
  • ???(pipe) ???? ??? ?? ?? ??? ???? ??
  • ??
  • commandA commandB (pipe) ??? ?? ??? ?????
    ???? ?? ??? ?????? ???

89
pipe

stdin
stdin
command A
command A
stderr
stdout
stderr
stdout
stderr
stdout
?? ps -ef more ls more ls sort -r
more command B ? filter ??? ?.
90
pipe redirection

stdin
stdin
stdin
command A
command A
command B
stderr
stdout
stderr
stdout
stderr
stdout
?? grep user /etc/passwd sort gt
sorted.users grep user lt /etc/passwd 2gt grep
.err sort gt sorted.users 2gt sort.err grep
user lt /etc/passwd sort 2gt sort.err wc -l gt
wc.out 2gt wc.err
91
Some Useful Commands
  • wc - word, line, and byte or character count
  • sort - sort or merge filesgrep
  • grep - search a file for a pattern
  • cut - cut out (extract) selected fields of each
    line of a file
  • tr - translate characters
  • find - find files
  • xargs - construct argument list(s) and execute
    command
  • sed - stream text editor
  • awk - pattern-directed scanning and processing
    language

92
cut
  • ??
  • cut -c list file ?? ?? stdin ?? ???
  • cut -f list -d char -s file ???
    character? field ? ???
  • option
  • -c character ??? ???
  • -f field ? ??? ???
  • -d -f ??? field ???. default ? tab. ?????
    quoting ??
  • -s -f ??? ???? ?? line ? ?? (??? ???? ??)
  • ?
  • date
  • Wed Mar 31 105118 JST 1999
  • date cut -c 1-3
  • Wed
  • date cut -d " " -f 1-3
  • Wed Mar 31

93
tr
  • ??
  • tr -s string1 string2 stdin?? ???
    characters? ???? stdout ?? ??
  • tr -d string1 string2
  • -s ???? ??? characters ? single character ? ??
  • -d character ? ???
  • ?
  • cat samplefile
  • This is sample file.
  • cat samplefile tr a-z A-Z
  • THIS IS SAMPLE FILE.
  • date
  • Wed Mar 31 113750 JST 1999
  • date tr a-z A-Z
  • WED MAR 31 113758 JST 1999
  • date cut -d -f 1,2 tr a-z" "A-Z"
  • WED MAR

94
find - ??
  • ??
  • find start_dir expressions actions
  • start_dir ???? ??. ?? ????? ????? ??
  • expressions ???? ??
  • -atime n ( or -n) access ??? n days ??(??)? ??
  • -mtime n( or -n) modify ??? n days ?? (??)? ??
  • -ctime n( or -n) create ??? n days ?? (??)? ??
  • -size nc(or -n) ?? ? n byte?? ?(??) ??. c? ???
    block??
  • -type x ?? type ? x ? ???? ??
  • f Regular file d Directory
  • b Block special file c Character special
    file
  • p FIFO (named pipe) l
    Symbolic link
  • s Socket
  • actions ???? ??? ??? ? ??? ?? ??
  • -print ?? ??? ??? ????.
  • -ls ?? ??? long format ?? ????.
  • -exec ?? ???? exec ?? ??? ??? ????.
  • -ok ?? ??? ???? ?? ????? ????.

95
find - Example
  • ?
  • find . -name .profile
  • find / -name f1
  • find . -name core
  • find . -name core -exec rm \
  • find / -mtime 7
  • find . -mtime -10 -ok rm \
  • find / -size 2000
  • find / -size -1000000c
  • find . -type f -exec chmod 444 \
  • find . -type d -exec chmod 555 \

96
sed - stream editor
  • ??
  • sed -n script file ... file(stdin)?? ???
    ??? script ? ???? ??? stdout ?? ????.
  • sed -n -e script ... -f script_file ...
    file ...
  • -n stdout ?? ??? ???? ???.
  • -e script ? ???? ?? ??
  • -f script_file script ? ??? ?? ??
  • ?
  • sed 's/abc/xyz/' file1 gt file1.out
  • sed -e 's/abc/xyz/' -e 's/lmn/rst/' file1gt
    file1.out
  • ls -al sed -n '/....rwxrwx/p gt ls -al
    grep .rwxrwx

97
awk - Pattern-directed scanning and processing
language
  • ??
  • awk script filename ??(?)? ???? ?? script ?
    ???.
  • awk -f script_file filename ??? script_file
    ? ??
  • ?
  • ls -l samplefile
  • -rw-rw-rw- 1 user3 class 21 Mar
    31 1139 samplefile
  • ls -al samplefile awk 'print 4, 9'
  • class samplefile
  • cat data.txt
  • 10 20 30 40 50
  • 60 70 80 90 100
  • awk print 123 data.txt
  • 60
  • 210

98
awk - Pattern-directed scanning and processing
language
  • ??
  • awk script filename ??(?)? ???? ?? script ?
    ???.
  • awk -f script_file filename ??? script_file
    ? ??
  • ?
  • ls -l samplefile
  • -rw-rw-rw- 1 user3 class 21 Mar
    31 1139 samplefile
  • ls -al samplefile awk 'print 4, 9'
  • class samplefile
  • cat data.txt
  • 10 20 30 40 50
  • 60 70 80 90 100
  • awk print 123 data.txt
  • 60
  • 210

99
Shell II Lab
100
Shell II Lab (??)
101
6. Process Control
  • Process Control

102
ps ???
  • ??
  • ps -ef ???? ??? ????.
  • -e ????? ???? ?? ???? ?? ??
  • -f ???? ??? ?? ?? ??
  • ?
  • ps -ef
  • UID PID PPID C STIME TTY TIME
    COMMAND
  • root 0 0 0 Mar 23 ?
    019 swapper
  • root 1 0 0 Mar 23 ?
    000 init
  • user3 3677 3676 0 230116 ttyp1 000
    ksh
  • user3 3714 3677 0 230335 ttyp1
    000 grep user3
  • user3 3713 3677 5 230335 ttyp1
    000 ps -ef

103
Background Processing
  • ??
  • command Background? ??? ????.
  • ?
  • cat while_infinite
  • while true do
  • echo hello
  • done
  • while_infinite gt test.out
  • 3 18182
  • ps -f
  • UID PID PPID C STIME TTY TIME
    COMMAND
  • user3 18171 17880 0 220846 pts/3
    000 cat
  • user3 18182 17880 104 221051 pts/3 003
    -ksh
  • user3 17880 14020 0 200221 pts/3
    000 -ksh

104
Putting Jobs In Background/Foreground
  • jobs ?? ???? Job ??
  • ltCtrlgtZ ?? Foreground ? ???? ?? Job ? ??
    ? ?(suspend)??
  • fg pid or number ?? ????? Foreground ? ????
  • bg pid or number ?? Job Number? Background
    ? ????
  • while_infinite
  • 1 18817
  • jobs
  • 1 Running while_infinite
  • fg 18817
  • while_infinite
  • ltCtrlgt Z
  • 1 Stopped while_infinite
  • bg
  • 1 while_infinite

105
nohup ???
  • ??
  • nohup command ???? logout ? ??? ?? ??? ?
  • ?
  • nohup while_infinite
  • 1 18754
  • Sending output to nohup.out
  • exit
  • logout
  • Connection closed.
  • login user3
  • Password
  • ps -ef grep while
  • user3 18754 1 169 091940 ? 059 sh
    ./while_infinite

106
kill
  • ??
  • kill -s signal_name PID PID ??? ??????
    ????
  • kill -s signal_number PID PID ???.
  • -s signal_name or signal_number ?????? ???? ??
    ??? ?? ?? ?? . defaults ? TERM(15)
  • ?
  • while_infinite
  • 1 19198
  • until_infinite
  • 2 19200
  • kill 19198 kill -S TERM 19198 kill -1
  • 1 - Terminated while_infinite
  • kill -s KILL 19200
  • 2 Killed until_infinite
  • kill -9 0
  • Connection closed.

107
Process Control Lab
108
7. Shell Programming I
  • ??
  • ??
  • Branch
  • Loop

109
Shell Program
  • UNIX ???? ?? ?? Regular ???, UNIX?? ???? ??
    ?????? ????? ??.
  • File Permission ? r, x? ???? ??.
  • ????
  • filename ltReturngt x permission ? ?? ??
  • ksh filename ltReturngt x permission ? ?? ??
  • ksh -x filename ltReturngt ?????? ? ??? ???? ??
  • ???? ?? ??? ????.
  • Shell Program ?? ? ? ?? ??
  • ?? ??
  • ????? ??? ????
  • ??? ??? ?? ??
  • ?? (?? Check)/ ?? (Branch)/ ?? (Loop)

110
??? Shell Program ??
  • cat myprog
  • this is the program myprog
  • date
  • ls -F
  • chmod x myprog
  • myprog

111
Shell Program ?? ??? ????
  • colorlavender
  • cat color1
  • echo You are now running program color1
  • echo the value of the variable color is color
  • ls -l color1
  • -rw-rw-rw- 1 user3 class 89 Mar
    29 1153 color1
  • chmod x color1
  • color1
  • You are now running program color1
  • the value of the variable color is
  • export color
  • color1
  • You are now running program color1
  • the value of the variable color is lavender


112
Shell Program? Argument
  • Command Line
  • sh_program arg1 arg2 argN
  • 0 1 2 N
  • ?
  • cat color3
  • echo You are now running program 0
  • echo The value of command line argument \1 is
    1
  • echo The value of command line argument \2 is
    2
  • chmod x color3
  • color3 red green
  • You are now running program color3
  • The value of command line argument 1 is red
  • The value of command line argument 2 is green

113
Shell Program? Argument (Sample)
  • cat my_install
  • echo 0 will install 1 to your bin directory
  • chmod x 1
  • mv 1 HOME/bin
  • echo Installation of 1 is complete!
  • chmod x my_install
  • pwd
  • /home/user3
  • mkdir bin
  • my_install color3
  • my_install will install color3 to your bin
    directory
  • Installation of color3 is complete!
  • ls -l HOME/bin
  • -rwxrwxrwx 1 user3 class 139 Mar
    29 1158 color3

114
??? Shell Variables
  • ?? Shell Variable
  • Command Line Arguements? ?
  • ?? Command Line Arguments
  • ?
  • cat color4
  • echo There are command line arguments
  • echo They are
  • echo The first command line argument is 1
  • chmod x color4
  • color4 red green yellow blue
  • There are 4 command line arguments
  • They are red green yellow blue
  • The first command line argument is red

115
??? Shell Variables (Sample)
  • cat my_install2
  • echo 0 will install files to your bin
    directory
  • echo The files to be installed are
  • chmod x
  • mv HOME/bin
  • echo Installation is complete!
  • chmod x my_install2
  • my_install2 color1 color4
  • my_install2 will install 2 files to your bin
    directory
  • The files to be installed are color1 color4
  • Installation is complete!
  • ls -l HOME/bin
  • -rwxrwxrwx 1 user3 class 89 Mar
    29 1153 color1
  • -rwxrwxrwx 1 user3 class 101 Mar
    29 1221 color4

116
Shift ???
  • ??
  • shift n ??? ??? n ??? ???? ?? (n ??? 1)
  • ?
  • cat color5
  • orig_args
  • echo There are command line arguments echo
    They are
  • echo Shifting two arguments shift 2
  • echo There are command line arguments echo
    They are
  • color5 red green yellow blue orange
  • There are 5 command line arguments
  • They are red green yellow blue orange
  • Shifting two arguments
  • There are 3 command line arguments
  • They are yellow blue orange

117
Read ???
  • ??
  • read variable variable ?????? ??? ????
  • ?
  • cat color6
  • echo This program prompts for user input
  • echo "Please enter your favorite two colors -gt
    \c"
  • read color_a color_b
  • echo The colors you entered are color_a
    color_b
  • color6
  • This program prompts for user input
  • Please enter your favoriate two colors gt red
    blue
  • The colors you entered are red blue
  • color6
  • This program prompts for user input
  • Please enter your favoriate two colors -gt red
    blue white
  • The colors you entered are red blue white

118
Read ??? (Sample)
  • cat my_install3
  • echo 0 will install files to your bin directory
  • echo "Enter the names of the files -gt \c"
  • read filenames
  • chmod x filenames
  • mv filenames HOME/bin
  • echo Installation is complete!
  • my_install3
  • my_install3 will install files to your bin
    directory
  • Enter the names of the files -gt f1 f2
  • Installation is complete!
  • ls -l HOME/bin
  • -rwxr-xr-x 1 user3 class 32 Mar
    26 2208 f1
  • -rwxr-xr-x 1 user3 class 52 Mar
    26 2209 f2

119
Shell ?? ???
  • ??
  • function funct_name shell_script
  • or
  • funct_name ( ) shell_script
  • ?

function install gt gt echo Install file
1 gt chmod x 1 gt mv 1 HOME/bin gt
echo Install complete gt install myfile
install f3 Install file f3 Install complete
install () gt echo Install file 1 gt
chmod x 1 gt mv 1 HOME/bin gt
echo Install complete gt install myfile
install f3 Install file f3 Install complete
or
120
Return Code
  • shell variable ? holds the return code of the
    last command executed
  • 0 command completed without error (true)
  • non-zero command termiated with error (false)
  • ?

false echo ? 1 cp Usage cp -f-i -p
-e warnforceignore echo ? 1 echo ? 0
true echo ? 0 ls .. echo ? 0 echo ? 0
121
Test ???
  • ??
  • test expresssion expression ? evaluate ?? return
    code ? ???
  • expression
  • evalutation?? return code
  • true 0
  • false non-zero (commonly 1)
  • Test ???? ??? ??? ??? ? ??.
  • Integer
  • Strings
  • File

122
Test ??? - ?? ???
  • ??
  • number1 relation number2 ???? relation ? ??
    ???
  • relations
  • -lt Less than
  • -le Less than or equal to
  • -gt Greater than
  • -ge Greater than or equal to
  • -eq Equal to
  • -ne Not equal to
  • ? (assume X3)

X -gt 7 echo ? 1
X -lt 7 echo ? 0
123
Test ??? - ??????
  • ??
  • string1 string2 ?? ?????? ??
  • string1 ! string2 ?? ?????? ??
  • string ???? ??? 0 ?? ?
  • -z string
  • -n string ???? ??? 0? ??? ?
  • ?

Xabc X ! abc echo ? 1
Xabc X abc echo ? 0
124
Test ??? - ?? ???
  • ??
  • -option filename ??? ??? ???
  • test -option filename
  • -f ??? ???? ?? ??(????, ????? ??)?? true
  • -s ??? ???? ??? 0?? ?? true
  • -r ??? ???? ??? ??? true
  • -w ??? ???? ?? ??? true
  • -x ??? ???? ???? ??? true
  • -d ????? ???? true
  • ? ls -l color5
  • -rw-rw-rw- 1 user3 class 168 Mar
    29 1337 color5
  • test -f color5 echo ?
  • 0
  • test -d color5 echo ?
  • 1

125
Test ??? - ?? ???
  • ??
  • -o OR
  • -a AND
  • ! NOT
  • \( \) GROUPING
  • ?
  • "ANS" y -o "ANS" Y
  • "NUM" -gt 10 -a "NUM" -lt 20
  • test -s color3 -a -r color3
  • test ! -d color3
  • \( -eq 2 \) -a \( 1 -eq -n \) -a \(
    -d 2 -o -s 2 \)

126
If ??
if list A then list B else list
C fi
  • ??
  • ??

if list A then list B fi
or
1. list A? ????. 2. ?? ??? ??? list B? ????
???? list C ? ????.
1. list A? ????. 2. ?? ??? ??? list B? ????.
if X -lt 10 then echo X is less than
10 else echo X is not less than 10 fi
if test -s funfile then echo funfile
exists fi
127
Case ?? - Multi-direcitonal branching
  • ??
  • case word in
  • pattern1) list A
  • pattern2) list B
  • patternN) list N
  • ) list C
  • esac
  • ??

word? pattern1? ??? list A? ??, pattern2? ???
list B? ??, , ?? ?? ??? list C ? ????.
case option in 1) echo option 1
2) echo option 2 3) echo option
3 ) echo no option esac
case ANS in yes) echo O.K.
no) echo Not O.K. ) echo Invalid
answser esac
128
case ?? - sample
  • cat menu_with_case
  • echo COMMAND MEMU
  • echo d to display time and date
  • echo w to display all login user
  • echo l to display the contents of current dir
  • echo ""
  • echo "Please enter your choice \c"
  • read choice
  • case choice in
  • dD) date
  • wW) who
  • lL) ls
  • ) echo Invalide choice
  • esac

129
Arithmetic Evaluation
  • ??
  • let expression ???? ???
  • (( expression ))
  • ?
  • x10
  • y2
  • let xx2
  • echo x
  • 12
  • (( xx/(y2) ))
  • echo x
  • 3

130
while ??
  • ??
  • while list A
  • do
  • list B
  • done
  • ?

??(list A)? ?? ?? list B? ?? ????.
cat test_while X1 while (( X lt 10 )) do
echo X is X let XX1 done test_while X is
1 X is 2 .. X is 10
131
until ??
  • ??
  • until list A
  • do
  • list B
  • done
  • ?

??(list A)? ?? ??? list B? ?? ????.
cat test_until X1 while (( X gt 10 )) do
echo X is X let XX1 done test_until X is
1 X is 2 .. X is 10
132
for ??
  • ??
  • for variable in list A
  • do
  • list B
  • done
  • ?

variable ? list A? ??? ??? ?????list B ? ????.
cat test_for for X in 1 2 3 4 5 do echo
"2 X is \c" let XX2 echo X done
ksh test_for 2 1 is 2 2 2 is 4 2 3 is 6 2
4 is 8 2 5 is 10
133
break, continue, exit ???
  • break ??? ??? ????.
  • continue ??? ?? ??? ??? ?? ???? ????.
  • exit n ?????? ??? ????? n (??? ??? ??? ??
    ??)? return code ? ????.
  • ??

cat test_control while true do echo
"Enter file name to remove \c" read
file
Write a Comment
User Comments (0)
About PowerShow.com