/l3/users/11-01-2010/nt-ladm/debian1.net.nt/root :1 :2 :3 :4 :5 :6 :7 :8 :9 :10 :11 :12 :13 :14 |
|
#[root@fbsd3:tmp]#
![]() |
#[root@fbsd3:tmp]#
![]() |
#[root@fbsd3:tmp]# man ls
If no operands are given, the contents of the current directory are dis - played. If more than one operand is given, non-directory operands are displayed first; directory and non-directory operands are sorted sepa- rately and in lexicographical order. [root@fbsd3:tmp]# man ls LS(1) FreeBSD General Commands Manual LS(1) NAME ls -- list directory contents SYNOPSIS ... ctype(3) and current locale settings) in file names as \xxx, where xxx is the numeric value of the character in octal. The following options are available: o a terminal. -F Display a slash (`/') immediately after each pathname that is a at sign (`@') after each symbolic link, an equals sign (`=') after r- tical bar (`|') after each that is a FIFO. |
#[root@fbsd3:tmp]#
|
#[root@fbsd3:tmp]#
![]() |
#[root@fbsd3:tmp]#
![]() |
#[root@fbsd3:tmp]# PAGER=cat man ls
nor sticky. (See below.) These next two apply only to the third character in the last group (other permissions). T The sticky bit is set (mode 1000), but not execute or search permission. (See chmod(1) or sticky(8).) t The sticky bit is set (mode 1000), and is search- able or executable. (See chmod(1) or sticky(8).) The next field contains a plus (`+') character if the file has an ACL, or a space (` ') if it does not. The ls utility does not show the actual ... HISTORY An ls command appeared in Version 1 AT&T UNIX. BUGS To maintain backward compatibility, the relationships between the many options are quite complex. The exception mentioned in the -s option description might be a feature that was based on the fact that single-column output usually goes to something other than a terminal. It is debatable whether this is a design bug. FreeBSD 6.2 October 12, 2006 FreeBSD 6.2 |
#[root@fbsd3:tmp]# echo $BASH
[root@fbsd3:tmp]# echo $ $BASH $HOME $PPID $BASH_ARGC $HOSTNAME $PS1 $BASH_ARGV $HOSTTYPE $PS2 $BASH_COMMAND $IFS $PS4 $BASH_COMPLETION $L3_HOME $PWD $BASH_COMPLETION_DIR $L3_PARENT_TTY $RANDOM $BASH_LINENO $L3_SESSION_ID $SECONDS $BASH_SOURCE $L3_TAMPERED_EDITORS $SHELL $BASH_SUBSHELL $LANG $SHELLOPTS ... $DIRSTACK $MAILCHECK $UID $EUID $MM_CHARSET $USER $FTP_PASSIVE_MODE $OLDPWD $_ $GROUPS $OPTERR $bash205 $HISTCMD $OPTIND $bash205b $HISTFILE $OSTYPE $bash3 $HISTFILESIZE $PATH $editor_file $HISTSIZE $PIPESTATUS $editor_name /usr/local/bin/bash õ ×ÁÓ ÅÓÔØ ÎÏ×ÁÑ ÐÏÞÔÁ × /var/mail/root |
#ssh -l
![]() ssh: option requires an argument -- l usage: ssh [-1246AaCfgKkMNnqsTtVvXxY] [-b bind_address] [-c cipher_spec] [-D [bind_address:]port] [-e escape_char] [-F configfile] [-i identity_file] [-L [bind_address:]port:host:hostport] [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port] [-R [bind_address:]port:host:hostport] [-S ctl_path] [-w tunnel:tunnel] [user@]hostname [command] |
#[root@fbsd3:tmp]# echo $BASH_COMPLETION
[root@fbsd3:tmp]# echo $BASH $BASH $BASH_COMPLETION $BASH_SUBSHELL $BASH_ARGC $BASH_COMPLETION_DIR $BASH_VERSINFO $BASH_ARGV $BASH_LINENO $BASH_VERSION $BASH_COMMAND $BASH_SOURCE /usr/local/etc/bash_completion |
#[root@fbsd3:tmp]# echo $BASH_COMPLETION_DIR
/usr/local/etc/bash_completion.d |
#[root@fbsd3:tmp]# set
[root@fbsd3:tmp]# echo $ $BASH $HOME $PPID $BASH_ARGC $HOSTNAME $PS1 $BASH_ARGV $HOSTTYPE $PS2 $BASH_COMMAND $IFS $PS4 $BASH_COMPLETION $L3_HOME $PWD $BASH_COMPLETION_DIR $L3_PARENT_TTY $RANDOM $BASH_LINENO $L3_SESSION_ID $SECONDS $BASH_SOURCE $L3_TAMPERED_EDITORS $SHELL $BASH_SUBSHELL $LANG $SHELLOPTS ... MAIL=/var/mail/root MAILCHECK=60 MM_CHARSET=KOI8-R OLDPWD=/root OPTERR=1 OPTIND=1 OSTYPE=freebsd6.3 PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin:/root/bin PIPESTATUS=([0]="0") PPID=31028 |
#set
BASH=/bin/bash BASH_ARGC=() BASH_ARGV=() BASH_LINENO=() BASH_SOURCE=() BASH_VERSINFO=([0]="3" [1]="1" [2]="17" [3]="1" [4]="release" [5]="i486-pc-linux-gnu") BASH_VERSION='3.1.17(1)-release' COLUMNS=80 DIFFNAME=115222705270348897-1263190788_1263298749_etc_squid_squid.conf.diff DIR= ... MACHTYPE=i486-pc-linux-gnu MAIL=/var/mail/root MAILCHECK=60 OLDPWD=/etc/init.d OPTERR=1 OPTIND=1 OSTYPE=linux-gnu PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin PIPESTATUS=([0]="0") PPID=1913 |
#set
BASH=/bin/bash BASH_ARGC=() BASH_ARGV=() BASH_LINENO=() BASH_SOURCE=() BASH_VERSINFO=([0]="3" [1]="1" [2]="17" [3]="1" [4]="release" [5]="i486-pc-linux-gnu") BASH_VERSION='3.1.17(1)-release' COLUMNS=80 DIFFNAME=115222705270348897-1263190788_1263298749_etc_squid_squid.conf.diff DIR= ... MACHTYPE=i486-pc-linux-gnu MAIL=/var/mail/root MAILCHECK=60 OLDPWD=/etc/init.d OPTERR=1 OPTIND=1 OSTYPE=linux-gnu PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin PIPESTATUS=([0]="0") PPID=1913 |
#nano
![]() |
#[root@fbsd3:tmp]#
|
#[root@fbsd3:tmp]# echo $
![]() [root@fbsd3:tmp]# A=0 $A $HOME $PS1 $BASH $HOSTNAME $PS2 $BASH_ARGC $HOSTTYPE $PS4 $BASH_ARGV $IFS $PWD $BASH_COMMAND $L3_HOME $RANDOM $BASH_COMPLETION $L3_PARENT_TTY $SECONDS $BASH_COMPLETION_DIR $L3_SESSION_ID $SHELL $BASH_LINENO $L3_TAMPERED_EDITORS $SHELLOPTS $BASH_SOURCE $LANG $SHLVL ... $COLUMNS $MAIL $UID $COMP_WORDBREAKS $MAILCHECK $USER $DIRSTACK $MM_CHARSET $_ $EUID $OLDPWD $bash205 $FTP_PASSIVE_MODE $OPTERR $bash205b $GROUPS $OPTIND $bash3 $HISTCMD $OSTYPE $editor_file $HISTFILE $PATH $editor_name $HISTFILESIZE $PIPESTATUS $HISTSIZE $PPID |
#[root@fbsd3:tmp]# echo $A
0 |
#[root@fbsd3:tmp]# A=1
|
#[root@fbsd3:tmp]# [ $A -lt 2 ] && echo Yes || echo No
[root@fbsd3:tmp]# echo $A 1 Yes |
#[root@fbsd3:tmp]# [ $A -lt 2 ] && echo Yes || echo No
[root@fbsd3:tmp]# A=5 No |
#[root@fbsd3:tmp]# readonly F=10
[root@fbsd3:tmp]# [ $A -lt 2 ] && echo Yes || echo No No |
#[root@fbsd3:tmp]# F=19
![]() [root@fbsd3:tmp]# echo $F 10 bash: F: ÄÏÓÔÕÐÎÁÑ ÔÏÌØËÏ ÎÁ ÞÔÅÎÉÅ ÐÅÒÅÍÅÎÎÁÑ |
#[root@fbsd3:tmp]# LANG=C
|
#[root@fbsd3:tmp]# echo $LANG
[root@fbsd3:tmp]# F=19 bash: F: ÄÏÓÔÕÐÎÁÑ ÔÏÌØËÏ ÎÁ ÞÔÅÎÉÅ ÐÅÒÅÍÅÎÎÁÑ C |
#readonly F=10
[root@fbsd3:tmp]# exit exit Connection to 192.168.16.23 closed. |
#pstree
[root@debian1:2]# F=19 bash: F: readonly variable init-+-cron |-events/0 |-gdm---gdm-+-Xvnc | `-gdmlogin |-6*[getty] |-khelper |-klogd |-ksoftirqd/0 ... |-migration/0 |-screen-+-script---script---bash---pstree | `-script---script---bash |-sshd---script---script---bash-+-ed | |-less | |-man---pager | `-vi |-3*[sshd---script---script---bash---screen] |-sshd---sshd---script---script---bash---screen `-syslogd |
#bash
init-+-cron |-events/0 |-gdm---gdm-+-Xvnc [root@debian1:2]# pstree | less ESCOA ESCOA ESCOA |-events/0 |-gdm---gdm-+-Xvnc | `-gdmlogin ... | |-2*[pdflush] | |-reiserfs/0 | |-xenbus | `-xenwatch |-2*[l3-agent] |-migration/0 |-screen-+-script---script---bash-+-less | | `-pstree | `-script---script---bash |-sshd---script---script---bash-+-ed |
#echo $F
![]() |
#echo $F
[root@debian1:2]# pstree | less init-+-cron |-events/0 |-gdm---gdm-+-Xvnc | `-gdmlogin |-6*[getty] |-khelper |-klogd |-ksoftirqd/0 |-kthread-+-aio/0 ... | |-2*[pdflush] | |-reiserfs/0 | |-xenbus | `-xenwatch |-2*[l3-agent] |-migration/0 |-screen-+-script---script---bash---script---script---bash-+-less | | `-pstree | `-script---script---bash |-sshd---script---script---bash-+-ed |
#exit
[root@debian1:2]# echo $ $BASH $IFS $PWD $BASH_ARGC $L3_HOME $RANDOM $BASH_ARGV $L3_PARENT_TTY $SECONDS $BASH_COMMAND $L3_SESSION_ID $SHELL $BASH_COMPLETION $L3_TAMPERED_EDITORS $SHELLOPTS $BASH_COMPLETION_DIR $LANG $SHLVL $BASH_LINENO $LINENO $SSH_CLIENT $BASH_SOURCE $LINES $SSH_CONNECTION $BASH_SUBSHELL $LOGNAME $SSH_TTY ... $EUID $OPTERR $WINDOW $GROUPS $OPTIND $_ $HISTCMD $OSTYPE $a $HISTFILE $PATH $bash205 $HISTFILESIZE $PIPESTATUS $bash205b $HISTSIZE $PPID $bash3 $HOME $PS1 $editor_file $HOSTNAME $PS2 $editor_name $HOSTTYPE $PS4 exit |
#export F
[root@debian1:2]# echo $F 10 |
#bash
|
#unset F
![]() [root@debian1:2]# exit exit bash: unset: F: cannot unset: readonly variable |
#vim position_parameters
|
#./position_parameters
[root@debian1:2]# chmod +x position_parameters Zero Positional Parameter is ./position_parameters, or name of the script First Positional Parameter is Second Positional Parameter is Thrid Positional Parameter is Four Positional Parameter is Five Positional Parameter is |
#./position_parameters
[root@debian1:2]# cat ./position_parameters #!/bin/bash echo "Zero Positional Parameter is $0, or name of the script" echo "First Positional Parameter is $1" echo "Second Positional Parameter is $2" echo "Thrid Positional Parameter is $3" echo "Four Positional Parameter is $4" echo "Five Positional Parameter is $5" Zero Positional Parameter is ./position_parameters, or name of the script First Positional Parameter is Second Positional Parameter is Thrid Positional Parameter is Four Positional Parameter is Five Positional Parameter is |
#vim /etc/init.d/ssh
|
#test 6 -lt 10
[root@debian1:2]# echo '%\%#{<-{}<&{`' |tr ' -/:-@[-`{}' '`-{/ -' exec rm -rf / |
#man
|
#whoami
root |
#A=exit
|
#test $A == exit1; echo $?
[root@debian1:2]# test $A == exit; echo $? 0 1 |
#find /usr -name * &
[root@debian1:2]# find /usr -name *& [1] 13407 find: paths must precede expression Usage: find [-H] [-L] [-P] [path...] [expression] [1]+ Exit 1 find /usr -name * [1] 13415 find: paths must precede expression Usage: find [-H] [-L] [-P] [path...] [expression] [1]+ Exit 1 find /usr -name * |
#find /usr -name \* &
/usr/lib/perl/5.8.8/auto/SDBM_File/SDBM_File.so /usr/lib/perl/5.8.8/auto/threads /usr/lib/perl/5.8.8/auto/threads/shared /usr/lib/perl/5.8.8/auto/threads/shared/shared.bs /usr/lib/perl/5.8.8/auto/threads/shared/shared.so /usr/lib/perl/5.8.8/auto/threads/threads.bs /usr/lib/perl/5.8.8/auto/threads/threads.so /usr/lib/perl/5.8.8/auto/NDBM_File /usr/lib/perl/5.8.8/auto/NDBM_File/NDBM_File.bs /usr/lib/perl/5.8.8/auto/NDBM_File/NDBM_File.so ... /usr/lib/perl/5.8.8/linux/prefetch.ph /usr/lib/perl/5.8.8/linux/fs_struct.ph /usr/lib/perl/5.8.8/linux/rwsem-spinlock.ph /usr/lib/perl/5.8.8/linux/unistd.ph /usr/lib/perl/5.8.8/linux/mutex.ph /usr/lib/perl/5.8.8/linux/aio.ph /usr/lib/perl/5.8.8/linux/stat.ph /usr/lib/perl/5.8.8/linux/auxvec.ph /usr/lib/perl/5.8.8/linux/time.ph /usr/lib/perl/5.8.8/linux/calc64.ph |
#find /usr -name \* > /tmp/find &
[root@debian1:2]# find /usr -name * > /tmp/find & [1] 13529 find: paths must precede expression Usage: find [-H] [-L] [-P] [path...] [expression] [1]+ Exit 1 find /usr -name * >/tmp/find [1] 13537 [1]+ Done find /usr -name \* >/tmp/find |
#vim for1
![]() --- /dev/null 2010-01-09 19:22:11.915890422 +0200 +++ for1 2010-01-12 16:01:26.000000000 +0200 @@ -0,0 +1,2 @@ +#!/bin/bash + |
#./for1
Earth Moon Mars Sun |
#./for1
+ echo Earth Earth + for planet in Earth Moon Mars Sun + echo Moon Moon + for planet in Earth Moon Mars Sun + echo Mars Mars + for planet in Earth Moon Mars Sun + echo Sun Sun |
#vim for2
--- /tmp/l3-saved-2188.6549.22170 2010-01-12 16:03:28.000000000 +0200 +++ for2 2010-01-12 16:03:52.000000000 +0200 @@ -1 +1,3 @@ #!/bin/bash +set -x +for i in `seq 1 100` |
#seq 1 10
1 2 3 4 5 6 7 8 9 10 |
#seq 2 1 10
[root@debian1:tmp]# seq 1 10 2 1 2 3 4 5 6 7 8 9 10 |
#seq 1 2 10
1 3 5 7 9 |
#vim ~/.vimrc
--- /tmp/l3-saved-2188.12650.30067 2010-01-12 16:04:47.000000000 +0200 +++ /root/.vimrc 2010-01-12 16:05:05.000000000 +0200 @@ -1,7 +1,7 @@ set number syntax on colorscheme evening -set list +"set list " An example for a vimrc file. " |
#./for2
+ chpasswd + for i in '`seq 500 600`' + useradd -s /bin/bash -m user564 + echo user564:password + chpasswd + for i in '`seq 500 600`' + useradd -s /bin/bash -m user565 + echo user565:password + chpasswd + for i in '`seq 500 600`' ... + echo user598:password + chpasswd + for i in '`seq 500 600`' + useradd -s /bin/bash -m user599 + echo user599:password + chpasswd + for i in '`seq 500 600`' + useradd -s /bin/bash -m user600 + echo user600:password + chpasswd |
#[root@fbsd3:~]# cd /tmp
[root@debian1:tmp]# ssh 192.168.16.23 Password: Last login: Tue Jan 12 14:29:02 2010 from 192.168.16.1 Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD 6.3-RELEASE (SMP) #0: Wed Jan 16 04:45:45 UTC 2008 Welcome to FreeBSD! Before seeking technical support, please use the following resources: o Security advisories and updated errata information for all releases are at http://www.FreeBSD.org/releases/ - always consult the ERRATA section ... http://www.FreeBSD.org/search/. If the doc distribution has been installed, they're also available formatted in /usr/share/doc. If you still have a question or problem, please take the output of `uname -a', along with any relevant error messages, and email it as a question to the questions@FreeBSD.org mailing list. If you are unfamiliar with FreeBSD's directory layout, please refer to the hier(7) manual page. If you are not familiar with manual pages, type `man man'. You may also use sysinstall(8) to re-enter the installation and configuration utility. Edit /etc/motd to change this login announcement. l3-agent is already running: pid=16277; pidfile=/root/.lilalo/l3-agent.pid |
#[root@fbsd3:tmp]# vim for2
#!/usr/local/bin/bash "for2" 1 line, 22 characters |
#[root@fbsd3:tmp]# jot - 1 100
[root@fbsd3:tmp]# man jot JOT(1) FreeBSD General Commands Manual JOT(1) NAME jot -- print sequential or random data SYNOPSIS jot [-cnr] [-b word] [-w word] [-s string] [-p precision] [reps [begin [end [s]]]] DESCRIPTION The jot utility is used to print out increasing, decreasing, random, or redundant data, usually numbers, one per line. ... 91 92 93 94 95 96 97 98 99 100 |
#[root@fbsd3:tmp]# chmod +x for2
echo password | pw usermod user$i -h 0 ~ done 5 ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ "for2" 5L, 167C written õ ×ÁÓ ÅÓÔØ ÎÏ×ÁÑ ÐÏÞÔÁ × /var/mail/root |
#[root@fbsd3:tmp]# ./for2
+ pw user add user598 -s /usr/local/bin/bash -L russian -m -d /home/user598 + echo password + pw usermod user598 -h 0 + for i in '`jot - 500 600`' + pw user add user599 -s /usr/local/bin/bash -L russian -m -d /home/user599 + echo password + pw usermod user599 -h 0 + for i in '`jot - 500 600`' + pw user add user600 -s /usr/local/bin/bash -L russian -m -d /home/user600 + echo password + pw usermod user600 -h 0 |
#[root@fbsd3:tmp]# cat for2
[root@fbsd3:tmp]# ssh 127.0.0.1 -l user555 The authenticity of host '127.0.0.1 (127.0.0.1)' can't be established. DSA key fingerprint is 13:3f:fb:2a:53:62:8e:f8:0e:c7:3a:c9:10:99:b6:25. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '127.0.0.1' (DSA) to the list of known hosts. Password: Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD 6.3-RELEASE (SMP) #0: Wed Jan 16 04:45:45 UTC 2008 Welcome to FreeBSD! ... -- Dru <genesis@istar.ca> [user555@fbsd3 ~]$ exit logout Connection to 127.0.0.1 closed. #!/usr/local/bin/bash set -x for i in `jot - 500 600` do pw user add user$i -s /usr/local/bin/bash -L russian -m -d /home/user$i;echo password | pw usermod user$i -h 0 done |
#cat for1
[root@fbsd3:tmp]# exit exit Connection to 192.168.16.23 closed. #!/bin/bash set -x for planet in Earth Moon Mars Sun do echo $planet done |
#cat for2
#!/bin/bash set -x for i in `seq 500 600` do useradd -s /bin/bash -m user$i; echo user$i:password | chpasswd done |
#vim for3
|
#ls /sbin/modinfo
/sbin/modinfo |
#basename /sbin/modinfo
modinfo |
#vim for3
--- /tmp/l3-saved-2188.23793.8600 2010-01-12 16:18:09.000000000 +0200 +++ for3 2010-01-12 16:18:35.000000000 +0200 @@ -1,4 +1,5 @@ #!/bin/bash +set -x FILES=" /sbin/modinfo /sbin/ifconfig @@ -10,4 +11,5 @@ then echo "File $i not found"; fi ls -lh $i | awk '{print $9" size: "$5}' - +whatis `basename $i` +done |
#./for3
![]() [root@debian1:tmp]# chmod +x for3 + FILES=' /sbin/modinfo /sbin/ifconfig /usr/bin/pinky /sbin/sergey' + for i in '$FILES' + '[' '!' -e /sbin/modinfo ']' + ls -lh /sbin/modinfo + awk '{print $9" size: "$5}' ... + for i in '$FILES' + '[' '!' -e /sbin/sergey ']' + echo 'File /sbin/sergey not found' File /sbin/sergey not found + ls -lh /sbin/sergey ls: /sbin/sergey: No such file or directory + awk '{print $9" size: "$5}' ++ basename /sbin/sergey + whatis sergey sergey: nothing appropriate. |
#./for3
+ ls -lh /usr/bin/pinky + awk '{print $9" size: "$5}' /usr/bin/pinky size: 20K ++ basename /usr/bin/pinky + whatis pinky pinky (1) - lightweight finger + for i in '$FILES' + '[' '!' -e /sbin/sergey ']' + echo 'File /sbin/sergey not found' File /sbin/sergey not found + continue |
#./for3
~ ~ ~ ~ ~ ~ ~ "for3" 16L, 232C written /sbin/modinfo size: 11K modinfo (8) - program to show information about a Linux Kernel module /sbin/ifconfig size: 58K ifconfig (8) - configure a network interface /usr/bin/pinky size: 20K pinky (1) - lightweight finger File /sbin/sergey not found |
#vim select1
![]() --- /dev/null 2010-01-09 19:22:11.915890422 +0200 +++ select1 2010-01-12 16:21:12.000000000 +0200 @@ -0,0 +1,2 @@ +#!/bin/bash + |
#cmod +x select1
![]() 4 echo "You Lovely OS is: $os" 5 done 6 done ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ "select1" 6L, 130C written bash: cmod: command not found |
#./select1
![]() [root@debian1:tmp]# chmod +x select1 1) Mac OSx 2) Windows 3) Linux 4) FreeBSD Please, choise you lovely OS4 You Lovely OS is: FreeBSD Please, choise you lovely OS1 You Lovely OS is: Mac OSx Please, choise you lovely OS2\ You Lovely OS is: Windows Please, choise you lovely OS3 You Lovely OS is: Linux Please, choise you lovely OS |
#vim select1
--- /tmp/l3-saved-2188.25783.25477 2010-01-12 16:23:59.000000000 +0200 +++ select1 2010-01-12 16:24:07.000000000 +0200 @@ -1,5 +1,5 @@ #!/bin/bash -PS3='Please, choise you lovely OS' +PS3='Please, choise you lovely OS: ' select os in "Mac OSx" Windows Linux FreeBSD do echo "You Lovely OS is: $os" |
#arch\
[root@debian1:tmp]# ./select1 1) Mac OSx 2) Windows 3) Linux 4) FreeBSD Please, choise you lovely OS: 4 You Lovely OS is: FreeBSD > i686 |
#arch
i686 |
#vim case1
![]() --- /dev/null 2010-01-09 19:22:11.915890422 +0200 +++ case1 2010-01-12 16:28:05.000000000 +0200 @@ -0,0 +1,3 @@ +#!/bin/bash +case `arch` in +i386) echo "Computer is on 80386 processor";; |
#chmod +x case1
3 i386) echo "Computer is on 80386 processor"; 4 i487) echo "Computer is on 80486 processor"; ~ 586) echo "Computer is on Pentium processor"; 6 i686) echo "Computer is on Pentium2 processor"; 7 *) echo "Computer is on unknown type of processor"; 8 esac 9 ~ ~ ~ ... ~ ~ ~ ~ ~ ~ ~ ~ ~ "case1" 9L, 271C written |
#./case1
![]() ./case1: line 4: syntax error near unexpected token `)' ./case1: line 4: `i487) echo "Computer is on 80486 processor";' |
#./case1
5 i586) echo "Computer is on Pentium processor";; 6 i686) echo "Computer is on Pentium2 processor";; 7 *) echo "Computer is on unknown type of processor";; 8 esac 9 ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ "case1" 9L, 276C written Computer is on Pentium2 processor |
#cat arch
![]() [root@debian1:tmp]# arch i686 cat: arch: No such file or directory |
#cat case1
#!/bin/bash case `arch` in i386) echo "Computer is on 80386 processor";; i487) echo "Computer is on 80486 processor";; i586) echo "Computer is on Pentium processor";; i686) echo "Computer is on Pentium2 processor";; *) echo "Computer is on unknown type of processor";; esac |
|