/l3/users/07-07-2008/fbsd-adm/fbsd1.unix.nt/root :1 :2 :3 :4 :5 :6 :7 :8 :9 :10 :11 :12 :13 :14 :15 :16 :17 :18 :19 :20 :21 :22 :23 :24 :25 :26 :27 :28 :29 :30 |
|
#./while1
+ read + pw user add -s /usr/local/bin/bash -L russian -m -d /home/ pw: user name or id required + echo password + pw usermod -h 0 pw: user name or id required + read + pw user add -s /usr/local/bin/bash -L russian -m -d /home/ pw: user name or id required + pw usermod -h 0 ... + pw usermod -h 0 pw: user name or id required + echo password + read + pw user add -s /usr/local/bin/bash -L russian -m -d /home/ pw: user name or id required + echo password + pw usermod -h 0 pw: user name or id required + read |
#vim while1
--- /tmp/l3-saved-58102.15128.23908 2008-07-09 12:45:40.000000000 +0300 +++ while1 2008-07-09 12:45:43.000000000 +0300 @@ -1,5 +1,5 @@ #!/usr/local/bin/bash -set -x +#set -x while read $users do pw user add $users -s /usr/local/bin/bash -L russian -m -d /home/$users ; |
#./while1
pw: user name or id required pw: user name or id required pw: user name or id required pw: user name or id required pw: user name or id required pw: user name or id required pw: user name or id required pw: user name or id required pw: user name or id required pw: user name or id required |
#vim while1
--- /tmp/l3-saved-58102.26399.3148 2008-07-09 12:45:49.000000000 +0300 +++ while1 2008-07-09 12:51:25.000000000 +0300 @@ -1,7 +1,7 @@ #!/usr/local/bin/bash #set -x -while read $users +cat /tmp/name | while read users do pw user add $users -s /usr/local/bin/bash -L russian -m -d /home/$users ; echo password | pw usermod $users -h 0; -done < /tmp/name +done |
#vim while1
--- /tmp/l3-saved-58102.8762.4471 2008-07-09 12:51:28.000000000 +0300 +++ while1 2008-07-09 12:51:54.000000000 +0300 @@ -1,7 +1,8 @@ #!/usr/local/bin/bash #set -x -cat /tmp/name | while read users +#cat /tmp/name | while read users +while read users do pw user add $users -s /usr/local/bin/bash -L russian -m -d /home/$users ; echo password | pw usermod $users -h 0; -done +done < /tmp/name |
#vim while1
--- /tmp/l3-saved-58102.14545.6225 2008-07-09 12:51:57.000000000 +0300 +++ while1 2008-07-09 12:52:01.000000000 +0300 @@ -1,5 +1,5 @@ #!/usr/local/bin/bash -#set -x +set -x #cat /tmp/name | while read users while read users do |
#./while1
+ read users + pw user add administrator -s /usr/local/bin/bash -L russian -m -d /home/administrator + echo password + pw usermod administrator -h 0 + read users + pw user add admin -s /usr/local/bin/bash -L russian -m -d /home/admin + echo password + pw usermod admin -h 0 + read users + pw user add domainadmin -s /usr/local/bin/bash -L russian -m -d /home/domainadmin + echo password + pw usermod domainadmin -h 0 + read users + pw user add director -s /usr/local/bin/bash -L russian -m -d /home/director + echo password + pw usermod director -h 0 + read users + pw user add secretary -s /usr/local/bin/bash -L russian -m -d /home/secretary + echo password + pw usermod secretary -h 0 + read users |
#vim while1
|
#cat while1
#!/usr/local/bin/bash set -x #cat /tmp/name | while read users while read users do pw user add $users -s /usr/local/bin/bash -L russian -m -d /home/$users ; echo password | pw usermod $users -h 0; done < /tmp/name |
#vim select1
--- /dev/null 2008-07-09 12:57:08.000000000 +0300 +++ select1 2008-07-09 12:57:17.000000000 +0300 @@ -0,0 +1,2 @@ +#!/usr/local/bin/bash + |
#vim select1
--- /tmp/l3-saved-58102.5244.575 2008-07-09 12:57:23.000000000 +0300 +++ select1 2008-07-09 12:59:01.000000000 +0300 @@ -1,2 +1,7 @@ #!/usr/local/bin/bash +PS3="Please, choisu you lovely city: " +select city in "Los Angeles" Kiev Moscow Vladivostok +do +echo "You lovely city is: $city." +done |
#chmod a+x select1
|
#./select1
1) Los Angeles 2) Kiev 3) Moscow 4) Vladivostok Please, choisu you lovely city: 4 You lovely city is: Vladivostok. Please, choisu you lovely city: 1 You lovely city is: Los Angeles. Please, choisu you lovely city: 3 You lovely city is: Moscow. Please, choisu you lovely city: 2 You lovely city is: Kiev. Please, choisu you lovely city: ^C |
#vim select1
--- /tmp/l3-saved-58102.8686.10326 2008-07-09 12:59:29.000000000 +0300 +++ select1 2008-07-09 12:59:34.000000000 +0300 @@ -3,5 +3,6 @@ select city in "Los Angeles" Kiev Moscow Vladivostok do echo "You lovely city is: $city." +break done |
#./select1
1) Los Angeles 2) Kiev 3) Moscow 4) Vladivostok Please, choisu you lovely city: 3 You lovely city is: Moscow. |
#ssh root@192.168.16.215
ssh: connect to host 192.168.16.215 port 22: Connection refused |
#vim /usr/local/etc/rc.d/gdm
|
#:q!
81 82 sshd_precmd() 83 { { 85 ! -f /etc/ssh/ssh_host_dsa_key -o \ 86 { ! -f /etc/ssh/ssh_host_rsa_key ]; then 87 user_reseed 88 run_rc_command keygen 89 fi 90 } 92 load_rc_config $name 91 if [ ! -f /etc/ssh/ssh_host_key -o \ |
# 54
|
#ssh clint@10.0.17.1
101 log_end_msg 0 102 else 103 log_end_msg 1 104 fi 105 ;; 106 107 restart) 108 check_privsep_dir 109 check_config 110 log_daemon_msg "Restarting OpenBSD Secure Shell server" "sshd" 111 start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile /var// run/sshd.pid 112 check_for_no_start log_end_msg 72 112,2-9 66% permitted by applicable law. Last login: Tue Jul 8 13:57:23 2008 from 192.168.16.215 clint@debian:~$ vim /etc/init.d/ssh |
#vim case1
--- /dev/null 2008-07-09 13:05:14.000000000 +0300 +++ case1 2008-07-09 13:05:14.000000000 +0300 @@ -0,0 +1,2 @@ +#! /usr/local/bin/bash + |
#vim case1
--- /tmp/l3-saved-58102.29495.28346 2008-07-09 13:05:15.000000000 +0300 +++ case1 2008-07-09 13:08:01.000000000 +0300 @@ -1,2 +1,10 @@ #! /usr/local/bin/bash +echo "Press any key and then enter." +read keypress +case $keypress in +[a-z] ) echo "This is a lower latter" ;; +[A-Z] ) echo "This is a upper later" ;; +[0-9] ) echo "This is digit";; +* ) echo "This is a puct";; +esac |
#chmod a+x case1
|
#./case1
Press any key and then enter. r This is a lower latter |
#./case1
Press any key and then enter. R This is a upper later |
#./case1
Press any key and then enter. $$ This is a puct |
#vim case1
--- /tmp/l3-saved-58102.3724.14519 2008-07-09 13:08:28.000000000 +0300 +++ case1 2008-07-09 13:08:53.000000000 +0300 @@ -1,4 +1,6 @@ #! /usr/local/bin/bash +while [ keypress != X ] +do echo "Press any key and then enter." read keypress case $keypress in @@ -7,4 +9,4 @@ [0-9] ) echo "This is digit";; * ) echo "This is a puct";; esac - +done |
#./case1
Press any key and then enter. d This is a lower latter Press any key and then enter. f This is a lower latter Press any key and then enter. ^ This is a puct Press any key and then enter. 6 This is digit Press any key and then enter. X This is a upper later Press any key and then enter. X This is a upper later Press any key and then enter. ^C |
#vim case1
--- /tmp/l3-saved-58102.22811.15134 2008-07-09 13:09:05.000000000 +0300 +++ case1 2008-07-09 13:09:14.000000000 +0300 @@ -1,5 +1,5 @@ #! /usr/local/bin/bash -while [ keypress != X ] +while [ $keypress != X ] do echo "Press any key and then enter." read keypress |
#vim case1
|
#./case1
./case1: line 2: [: !=: unary operator expected |
#vim case1
--- /tmp/l3-saved-58102.16780.17679 2008-07-09 13:09:22.000000000 +0300 +++ case1 2008-07-09 13:09:31.000000000 +0300 @@ -1,5 +1,5 @@ #! /usr/local/bin/bash -while [ $keypress != X ] +while [ "$keypres"s != X ] do echo "Press any key and then enter." read keypress |
#vim case1
--- /tmp/l3-saved-58102.6855.30987 2008-07-09 13:09:43.000000000 +0300 +++ case1 2008-07-09 13:09:51.000000000 +0300 @@ -1,5 +1,5 @@ #! /usr/local/bin/bash -while [ "$keypres"s != X ] +while [ "$keypress" != X ] do echo "Press any key and then enter." read keypress |
#./case1
Press any key and then enter. f This is a lower latter Press any key and then enter. X This is a upper later |
#cat case1
#! /usr/local/bin/bash while [ "$keypress" != X ] do echo "Press any key and then enter." read keypress case $keypress in [a-z] ) echo "This is a lower latter" ;; [A-Z] ) echo "This is a upper later" ;; [0-9] ) echo "This is digit";; * ) echo "This is a puct";; esac done |
#vim case1
--- /tmp/l3-saved-58102.15512.14622 2008-07-09 13:10:38.000000000 +0300 +++ case1 2008-07-09 13:10:48.000000000 +0300 @@ -1,9 +1,9 @@ #! /usr/local/bin/bash -while [ "$keypress" != X ] +while [ "$key" != X ] do echo "Press any key and then enter." -read keypress -case $keypress in +read key +case $key in [a-z] ) echo "This is a lower latter" ;; [A-Z] ) echo "This is a upper later" ;; [0-9] ) echo "This is digit";; |
#./case1
Press any key and then enter. d This is a lower latter Press any key and then enter. F This is a upper later Press any key and then enter. ^C |
#vim case1
--- /tmp/l3-saved-58102.31482.26332 2008-07-09 13:11:01.000000000 +0300 +++ case1 2008-07-09 13:11:38.000000000 +0300 @@ -1,8 +1,8 @@ #! /usr/local/bin/bash -while [ "$key" != X ] -do echo "Press any key and then enter." read key +while [ "$key" != X ] +do case $key in [a-z] ) echo "This is a lower latter" ;; [A-Z] ) echo "This is a upper later" ;; |
#./case1
This is a lower latter This is a lower latter This is a lower latter This is a lower latter This is a lower latter This is a lower latter This is a lower latter This is a lower latter This is a lower latter This is a lower latter ... This is a lower latter This is a lower latter This is a lower latter This is a lower latter This is a lower latter This is a lower latter This is a lower latter This is a lower latter This is a lower latter This is a lower latter |
#^C
^C ^C ^C ^C |
#vim case1
--- /tmp/l3-saved-58102.8680.6356 2008-07-09 13:11:54.000000000 +0300 +++ case1 2008-07-09 13:12:16.000000000 +0300 @@ -1,8 +1,9 @@ #! /usr/local/bin/bash -echo "Press any key and then enter." -read key + while [ "$key" != X ] do +echo "Press any key and then enter." +read key case $key in [a-z] ) echo "This is a lower latter" ;; [A-Z] ) echo "This is a upper later" ;; |
#./case1
Press any key and then enter. sdf This is a puct Press any key and then enter. f This is a lower latter Press any key and then enter. X This is a upper later |
#./case1
|
#vim for1
|
#~
|
#vim for4
--- /tmp/l3-saved-58102.20636.29533 2008-07-09 13:13:10.000000000 +0300 +++ for4 2008-07-09 13:15:19.000000000 +0300 @@ -1,5 +1,16 @@ #!/usr/local/bin/bash set -x +echo "Please, give username: " +read user +pw user add $user -s /usr/local/bin/bash -L russian -m -d /home/$user ; +echo "Please, give password: " +read pass +echo $pass | pw usermod $user -h 0 + + + + + for i in `jot 100 0` do pw user add user$i -s /usr/local/bin/bash \ -L russian -m -d /home/user$i ;\ |
#./for4
+ pw usermod user10 -h 0 + for i in '`jot 100 0`' + pw user add user11 -s /usr/local/bin/bash -L russian -m -d /home/user11 pw: login name `user11' already exists + echo password + pw usermod user11 -h 0 + for i in '`jot 100 0`' + pw user add user12 -s /usr/local/bin/bash -L russian -m -d /home/user12 pw: login name `user12' already exists + echo password ... + echo password + pw usermod user38 -h 0 + for i in '`jot 100 0`' + pw user add user39 -s /usr/local/bin/bash -L russian -m -d /home/user39 pw: login name `user39' already exists + echo password + pw usermod user39 -h 0 + for i in '`jot 100 0`' + pw user add user40 -s /usr/local/bin/bash -L russian -m -d /home/user40 pw: login name `user40' already exists^C |
#vim for4
--- /tmp/l3-saved-58102.31950.18426 2008-07-09 13:15:57.000000000 +0300 +++ for4 2008-07-09 13:16:07.000000000 +0300 @@ -6,14 +6,4 @@ echo "Please, give password: " read pass echo $pass | pw usermod $user -h 0 - - - - - -for i in `jot 100 0` -do pw user add user$i -s /usr/local/bin/bash \ --L russian -m -d /home/user$i ;\ -#chpass -p "\$1\$gi4.dgMH\$Ifm9bzNLOTcLwJ8SAGEtV." user$i -echo password | pw usermod user$i -h 0 -done +DOne |
#vim for4
|
#./for4
+ echo 'Please, give username: ' Please, give username: + read user testuser3 + pw user add testuser3 -s /usr/local/bin/bash -L russian -m -d /home/testuser3 + echo 'Please, give password: ' Please, give password: + read pass P@ssw0rd + echo P@ssw0rd + pw usermod testuser3 -h 0 + DOne ./for4: line 9: DOne: command not found |
#vim for4
--- /tmp/l3-saved-58102.31799.31383 2008-07-09 13:16:21.000000000 +0300 +++ for4 2008-07-09 13:16:29.000000000 +0300 @@ -6,4 +6,3 @@ echo "Please, give password: " read pass echo $pass | pw usermod $user -h 0 -DOne |
#./for4
+ echo 'Please, give username: ' Please, give username: + read user testuser4 + pw user add testuser4 -s /usr/local/bin/bash -L russian -m -d /home/testuser4 + echo 'Please, give password: ' Please, give password: + read pass P@ssw0rd + echo P@ssw0rd + pw usermod testuser4 -h 0 |
#vim for4
--- /tmp/l3-saved-58102.29533.12555 2008-07-09 13:16:43.000000000 +0300 +++ for4 2008-07-09 13:16:47.000000000 +0300 @@ -1,5 +1,5 @@ #!/usr/local/bin/bash -set -x +#set -x echo "Please, give username: " read user pw user add $user -s /usr/local/bin/bash -L russian -m -d /home/$user ; |
#./for4
Please, give username: igor Please, give password: password |
#man bash
|
#Pattern not found (press RETURN)
|
#vim for4
--- /tmp/l3-saved-58102.8751.7785 2008-07-09 13:17:20.000000000 +0300 +++ for4 2008-07-09 13:17:28.000000000 +0300 @@ -5,4 +5,5 @@ pw user add $user -s /usr/local/bin/bash -L russian -m -d /home/$user ; echo "Please, give password: " read pass +STTY off echo $pass | pw usermod $user -h 0 |
#./for4
Please, give username: ff Please, give password: ^C |
#vim for4
--- /tmp/l3-saved-58102.18994.27458 2008-07-09 13:17:37.000000000 +0300 +++ for4 2008-07-09 13:17:54.000000000 +0300 @@ -5,5 +5,5 @@ pw user add $user -s /usr/local/bin/bash -L russian -m -d /home/$user ; echo "Please, give password: " read pass -STTY off +#STTY off echo $pass | pw usermod $user -h 0 |
#cp for4 for5
|
#cat for4
#!/usr/local/bin/bash #set -x echo "Please, give username: " read user pw user add $user -s /usr/local/bin/bash -L russian -m -d /home/$user ; echo "Please, give password: " read pass #STTY off echo $pass | pw usermod $user -h 0 |
#vim for5
|
#~
7 echo $2 | pw usermod $1 -h 0 9 done $2 | pw usermod $1 -h 0 10 done 11 13 12 15 13 17 ~ ... ~ ~ ~ ~ ~ ~ ~ ~ ~ "for5" 10L, 279C written |
#./for5
./for5: line 7: syntax error near unexpected token `do' ./for5: line 7: `do' |
#vim for5
--- /tmp/l3-saved-58102.7729.17997 2008-07-09 13:21:55.000000000 +0300 +++ for5 2008-07-09 13:22:05.000000000 +0300 @@ -4,7 +4,7 @@ then echo "Please, give username [a-z][0-9] in first arg and password as second arg to this script" ; exit 1 else -do + pw user add $1 -s /usr/local/bin/bash -L russian -m -d /home/$1 ; echo $2 | pw usermod $1 -h 0 -done + |
#./for5
./for5: line 11: syntax error: unexpected end of file |
#vim for5
--- /tmp/l3-saved-58102.4132.13828 2008-07-09 13:22:10.000000000 +0300 +++ for5 2008-07-09 13:22:21.000000000 +0300 @@ -7,4 +7,4 @@ pw user add $1 -s /usr/local/bin/bash -L russian -m -d /home/$1 ; echo $2 | pw usermod $1 -h 0 - +fi |
#./for5
+ '[' -z '' ']' -o '[' -z '' ']' ./for5: line 3: [: too many arguments + pw user add -s /usr/local/bin/bash -L russian -m -d /home/ pw: user name or id required + echo + pw usermod -h 0 pw: user name or id required |
#vim for5
--- /tmp/l3-saved-58102.20610.18773 2008-07-09 13:22:27.000000000 +0300 +++ for5 2008-07-09 13:22:38.000000000 +0300 @@ -1,6 +1,6 @@ #!/usr/local/bin/bash set -x -if [ -z "$1" ] -o [ -z "$2" ] +if [ -z "$1" ] then echo "Please, give username [a-z][0-9] in first arg and password as second arg to this script" ; exit 1 else |
#./for5
+ '[' -z '' ']' + echo 'Please, give username [a-z][0-9] in first arg and password as second arg to this script' Please, give username [a-z][0-9] in first arg and password as second arg to this script + exit 1 |
#vim for5
|
#~
2 set -x 3 if [ -z "$1" ] rg to this script" ; exit 1 4 then 6 else 5 echo "Please, give username [a-z][0-9] in first arg and password as second aa 7 8 pw user add $1 -s /usr/local/bin/bash -L russian -m -d /home/$1 ; ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ "for5" 10L, 261C written |
#./for5
Please, give username [a-z][0-9] in first arg and password as second arg to this script |
#./for5 testuser6 P@ssw0rd
|
#vim for5
--- /tmp/l3-saved-58102.25381.10600 2008-07-09 13:23:20.000000000 +0300 +++ for5 2008-07-09 13:23:22.000000000 +0300 @@ -1,5 +1,5 @@ #!/usr/local/bin/bash -#set -x +set -x if [ -z "$1" ] then echo "Please, give username [a-z][0-9] in first arg and password as second arg to this script" ; exit 1 |
#./for5 testuser7 P@ssw0rd
+ '[' -z testuser7 ']' + pw user add testuser7 -s /usr/local/bin/bash -L russian -m -d /home/testuser7 + echo P@ssw0rd + pw usermod testuser7 -h 0 |
#vim for5
--- /tmp/l3-saved-58102.20670.31815 2008-07-09 13:23:39.000000000 +0300 +++ for5 2008-07-09 13:24:09.000000000 +0300 @@ -1,6 +1,6 @@ #!/usr/local/bin/bash set -x -if [ -z "$1" ] +if [ -z "$1" -o -z "$2" ] then echo "Please, give username [a-z][0-9] in first arg and password as second arg to this script" ; exit 1 else |
#./for5 testuser8 P@ssw0rd
+ '[' -z testuser8 -o -z P@ssw0rd ']' + pw user add testuser8 -s /usr/local/bin/bash -L russian -m -d /home/testuser8 + echo P@ssw0rd + pw usermod testuser8 -h 0 |
#./for5 testuser9
+ '[' -z testuser9 -o -z '' ']' + echo 'Please, give username [a-z][0-9] in first arg and password as second arg to this script' Please, give username [a-z][0-9] in first arg and password as second arg to this script + exit 1 |
#./for5
+ '[' -z '' -o -z '' ']' + echo 'Please, give username [a-z][0-9] in first arg and password as second arg to this script' Please, give username [a-z][0-9] in first arg and password as second arg to this script + exit 1 |
#./for5 testuser9
+ '[' -z testuser9 -o -z '' ']' + echo 'Please, give username [a-z][0-9] in first arg and password as second arg to this script' Please, give username [a-z][0-9] in first arg and password as second arg to this script + exit 1 |
#vim for5
--- /tmp/l3-saved-58102.2068.24749 2008-07-09 13:24:36.000000000 +0300 +++ for5 2008-07-09 13:24:39.000000000 +0300 @@ -1,5 +1,5 @@ #!/usr/local/bin/bash -set -x +#set -x if [ -z "$1" -o -z "$2" ] then echo "Please, give username [a-z][0-9] in first arg and password as second arg to this script" ; exit 1 |
#./for5 testuser9
Please, give username [a-z][0-9] in first arg and password as second arg to this script |
#./for5 testuser9 yyyy
|
#vim for5
--- /tmp/l3-saved-58102.6810.6591 2008-07-09 13:24:55.000000000 +0300 +++ for5 2008-07-09 13:25:02.000000000 +0300 @@ -4,7 +4,6 @@ then echo "Please, give username [a-z][0-9] in first arg and password as second arg to this script" ; exit 1 else - pw user add $1 -s /usr/local/bin/bash -L russian -m -d /home/$1 ; echo $2 | pw usermod $1 -h 0 fi |
#cat for4
#!/usr/local/bin/bash #set -x echo "Please, give username: " read user pw user add $user -s /usr/local/bin/bash -L russian -m -d /home/$user ; echo "Please, give password: " read pass #STTY off echo $pass | pw usermod $user -h 0 |
#cat for5
#!/usr/local/bin/bash #set -x if [ -z "$1" -o -z "$2" ] then echo "Please, give username [a-z][0-9] in first arg and password as second arg to this script" ; exit 1 else pw user add $1 -s /usr/local/bin/bash -L russian -m -d /home/$1 ; echo $2 | pw usermod $1 -h 0 fi |
#./case1
|
#ssh 192.168.16.215
[ 50.944015] hpet0: at MMIO 0xfed00000, IRQs 2, 8, 0 [ 50.944021] hpet0: 3 64-bit timers, 14318180 Hz [ 50.945065] AppArmor: AppArmor Filesystem Enabled [ 50.947785] Time: tsc clocksource has been installed. [ 50.955844] system 00:01: iomem range 0xfed13000-0xfed19fff has been reserved [ 50.955858] system 00:08: ioport range 0x290-0x297 has been reserved [ 50.955865] system 00:09: ioport range 0x4d0-0x4d1 has been reserved [ 50.955868] system 00:09: ioport range 0x800-0x87f has been reserved [ 50.955871] system 00:09: ioport range 0x400-0x41f has been reserved [ 50.955873] system 00:09: ioport range 0x480-0x4bf has been reserved ... [ 54.447355] hub 2-0:1.0: 2 ports detected [ 54.462949] libata version 3.00 loaded. [ 54.550820] ACPI: PCI Interrupt 0000:00:1d.2[C] -> GSI 18 (level, low) -> IRQ 18 [ 54.550835] PCI: Setting latency timer of device 0000:00:1d.2 to 64 [ 54.550840] uhci_hcd 0000:00:1d.2: UHCI Host Controller [ 54.550873] uhci_hcd 0000:00:1d.2: new USB bus registered, assigned bus number 3 [ 54.550906] uhci_hcd 0000:00:1d.2: irq 18, io base 0x00008400 [ 54.551030] usb usb3: configuration #1 chosen from 1 choice [ 54.551061] hub 3-0:1.0: USB hub found [ 54.551069] hub 3-0:1.0: 2 ports detected |
#cat select1
#!/bin/bash PS3="Please, choise USB-device for mounting: " select i in `dmesg | grep .*sd[a-z][1-9]$ | awk '{print$3}' | sort | uniq` 'exit' do if test $i = exit ; then break;fi if [ -d /mnt/$i ] ; then echo "Mounting directory is OK"; else mkdir /mnt/$i fi mount /dev/$i /mnt/$i ; mount | grep $i done |
#cp no_file /tmp
cp: no_file: No such file or directory |
#echo $?
1 |
#ls
'echo 09:48:03 | tr '[:lower:]' '[:upper:]'' 'echo 123456 | tr '[:lower:]' '[:upper:]'' 'echo 2008 | tr '[:lower:]' '[:upper:]'' 'echo 8 | tr '[:lower:]' '[:upper:]'' 'echo A:\WINDOWS\SYSTEM32 | tr '[:lower:]' '[:upper:]'' 'echo Jul | tr '[:lower:]' '[:upper:]'' 'echo NEWFILE | tr '[:lower:]' '[:upper:]'' 'echo TEST | tr '[:lower:]' '[:upper:]'' 'echo Tue Jul 8 09:48:20 UTC 2008 | tr '[:lower:]' '[:upper:]'' 'echo Tue | tr '[:lower:]' '[:upper:]'' ... case1 for1 for2 for3 for4 for5 name select1 test while1 |
#vim for5
|
#~ +q436f+q6b75+q6b64+q6b72+q6b6c+q2332+q2334+q2569+q2a37+q6b31
|
#man STTY
|
#apropos stty
stty(1) - set the options for a terminal device interface stty(3), gtty(3) - set and get terminal state (defunct) |
#man stty
|
#! /usr/local/bin/bash while [ "$keypress" != X ] do echo "Press any key and then enter." read keypress case $keypress in [a-z] ) echo "This is a lower latter" ;; [A-Z] ) echo "This is a upper later" ;; [0-9] ) echo "This is digit";; * ) echo "This is a puct";; esac done
#!/usr/local/bin/bash #set -x echo "Please, give username: " read user pw user add $user -s /usr/local/bin/bash -L russian -m -d /home/$user ; echo "Please, give password: " read pass #STTY off echo $pass | pw usermod $user -h 0
#!/usr/local/bin/bash #set -x if [ -z "$1" -o -z "$2" ] then echo "Please, give username [a-z][0-9] in first arg and password as second arg to this script" ; exit 1 else pw user add $1 -s /usr/local/bin/bash -L russian -m -d /home/$1 ; echo $2 | pw usermod $1 -h 0 fi
#!/bin/bash PS3="Please, choise USB-device for mounting: " select i in `dmesg | grep .*sd[a-z][1-9]$ | awk '{print$3}' | sort | uniq` 'exit' do if test $i = exit ; then break;fi if [ -d /mnt/$i ] ; then echo "Mounting directory is OK"; else mkdir /mnt/$i fi mount /dev/$i /mnt/$i ; mount | grep $i done
#!/usr/local/bin/bash set -x #cat /tmp/name | while read users while read users do pw user add $users -s /usr/local/bin/bash -L russian -m -d /home/$users ; echo password | pw usermod $users -h 0; done < /tmp/name
Время первой команды журнала | 12:45:31 2008- 7- 9 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 13:55:48 2008- 7- 9 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 101 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 19.80 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 0.99 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 1.17 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 1.44 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду w. В поле WHAT, соответствующем текущему терминалу, должна быть указана программа script.
Команды, при наборе которых были допущены синтаксические ошибки, выводятся перечёркнутым текстом:
$ l s-l bash: l: command not found |
Если код завершения команды равен нулю, команда была выполнена без ошибок. Команды, код завершения которых отличен от нуля, выделяются цветом.
$ test 5 -lt 4 |
Команды, ход выполнения которых был прерван пользователем, выделяются цветом.
$ find / -name abc find: /home/devi-orig/.gnome2: Keine Berechtigung find: /home/devi-orig/.gnome2_private: Keine Berechtigung find: /home/devi-orig/.nautilus/metafiles: Keine Berechtigung find: /home/devi-orig/.metacity: Keine Berechtigung find: /home/devi-orig/.inkscape: Keine Berechtigung ^C |
Команды, выполненные с привилегиями суперпользователя, выделяются слева красной чертой.
# id uid=0(root) gid=0(root) Gruppen=0(root) |
Изменения, внесённые в текстовый файл с помощью редактора, запоминаются и показываются в журнале в формате ed. Строки, начинающиеся символом "<", удалены, а строки, начинающиеся символом ">" -- добавлены.
$ vi ~/.bashrc
|
Для того чтобы изменить файл в соответствии с показанными в диффшоте изменениями, можно воспользоваться командой patch. Нужно скопировать изменения, запустить программу patch, указав в качестве её аргумента файл, к которому применяются изменения, и всавить скопированный текст:
$ patch ~/.bashrc |
Для того чтобы получить краткую справочную информацию о команде, нужно подвести к ней мышь. Во всплывающей подсказке появится краткое описание команды.
Если справочная информация о команде есть, команда выделяется голубым фоном, например: vi. Если справочная информация отсутствует, команда выделяется розовым фоном, например: notepad.exe. Справочная информация может отсутствовать в том случае, если (1) команда введена неверно; (2) если распознавание команды LiLaLo выполнено неверно; (3) если информация о команде неизвестна LiLaLo. Последнее возможно для редких команд.
Большие, в особенности многострочные, всплывающие подсказки лучше всего показываются браузерами KDE Konqueror, Apple Safari и Microsoft Internet Explorer. В браузерах Mozilla и Firefox они отображаются не полностью, а вместо перевода строки выводится специальный символ.
Время ввода команды, показанное в журнале, соответствует времени начала ввода командной строки, которое равно тому моменту, когда на терминале появилось приглашение интерпретатора
Имя терминала, на котором была введена команда, показано в специальном блоке. Этот блок показывается только в том случае, если терминал текущей команды отличается от терминала предыдущей.
Вывод не интересующих вас в настоящий момент элементов журнала, таких как время, имя терминала и других, можно отключить. Для этого нужно воспользоваться формой управления журналом вверху страницы.
Небольшие комментарии к командам можно вставлять прямо из командной строки. Комментарий вводится прямо в командную строку, после символов #^ или #v. Символы ^ и v показывают направление выбора команды, к которой относится комментарий: ^ - к предыдущей, v - к следующей. Например, если в командной строке было введено:
$ whoami
user
$ #^ Интересно, кто я?в журнале это будет выглядеть так:
$ whoami
user
Интересно, кто я? |
Если комментарий содержит несколько строк, его можно вставить в журнал следующим образом:
$ whoami
user
$ cat > /dev/null #^ Интересно, кто я?
Программа whoami выводит имя пользователя, под которым мы зарегистрировались в системе. - Она не может ответить на вопрос о нашем назначении в этом мире.В журнале это будет выглядеть так:
$ whoami user
|
Комментарии, не относящиеся непосредственно ни к какой из команд, добавляются точно таким же способом, только вместо симолов #^ или #v нужно использовать символы #=
1 2 3 4Группы команд, выполненных на разных терминалах, разделяются специальной линией. Под этой линией в правом углу показано имя терминала, на котором выполнялись команды. Для того чтобы посмотреть команды только одного сенса, нужно щёкнуть по этому названию.
LiLaLo (L3) расшифровывается как Live Lab Log.
Программа разработана для повышения эффективности обучения Unix/Linux-системам.
(c) Игорь Чубин, 2004-2008