/l3/users/28-09-2015/NT-Ladm/debian3.net.nt/root :1 :2 :3 :4 :5 :6 :7 :8 :9 :10 |
|
#echo $?
130 |
#exit
Есть приостановленные задачи. |
#echo $?
0 |
#cat &
[4] 10325 [4]+ Stopped cat |
#jobs
[1] Stopped /usr/bin/vi "$@" [2] Stopped /usr/bin/vi "$@" [3]- Stopped ps ax | more [4]+ Stopped cat |
#jobs -l
[1] 9855 Остановлено /usr/bin/vi "$@" [2] 9903 Остановлено /usr/bin/vi "$@" [3]- 10103 Done ps ax 10104 Остановлено | more [4]+ 10325 Остановлено (ввод с терминала) cat |
#cd /proc/10325/fd
|
#ls -l
итого 0 lrwx------ 1 root root 64 Сен 29 11:16 0 -> /dev/pts/1 lrwx------ 1 root root 64 Сен 29 11:16 1 -> /dev/pts/1 lrwx------ 1 root root 64 Сен 29 11:16 2 -> /dev/pts/1 |
#tty
/dev/pts/0 |
#pstree
init─┬─acpid ├─cron ├─exim4 ├─6*[getty] ├─2*[l3-agent] ├─rsyslogd───3*[{rsyslogd}] ├─sshd─┬─sshd───bash───script───script───l3script─┬─cat │ │ ├─more │ │ ├─pstree │ │ └─2*[vi] │ ├─sshd───sshd───bash───script───script───l3script │ └─2*[sshd───sshd───bash] └─udevd |
#pstree -p
init(1)─┬─acpid(1953) ├─cron(1976) ├─exim4(2249) ├─getty(2306) ├─getty(2307) ├─getty(2308) ├─getty(2309) ├─getty(2310) ├─getty(2311) ├─l3-agent(3398) ├─l3-agent(6209) ├─rsyslogd(1904)─┬─{rsyslogd}(1905) │ ├─{rsyslogd}(1907) │ └─{rsyslogd}(1908) ├─sshd(2282)─┬─sshd(8620)───bash(8622)───script(8667)───script(8698)───+ │ ├─sshd(8720)───sshd(8722)───bash(8723)───script(8768)───sc+ │ ├─sshd(8901)───sshd(8903)───bash(8904) │ └─sshd(8985)───sshd(8987)───bash(8988) └─udevd(277) |
#cd
|
#find / -user ivan -type f
/tmp/users /home/ivan/.bashrc /home/ivan/.bash_history /home/ivan/.profile /home/ivan/d2/d3/d1/users /home/ivan/d2/users /home/ivan/.bash_logout /proc/8904/task/8904/fdinfo/0 /proc/8904/task/8904/fdinfo/1 /proc/8904/task/8904/fdinfo/2 ... /proc/8904/oom_adj /proc/8904/oom_score_adj /proc/8904/loginuid /proc/8904/sessionid /proc/8904/coredump_filter /proc/8904/io find: `/proc/10395/task/10395/fd/5': Нет такого файла или каталога find: `/proc/10395/task/10395/fdinfo/5': Нет такого файла или каталога find: `/proc/10395/fd/5': Нет такого файла или каталога find: `/proc/10395/fdinfo/5': Нет такого файла или каталога |
#ls -l
итого 20 -rw-r--r-- 1 root root 354 Сен 29 11:20 errors -rw-r--r-- 1 root root 0 Сен 29 10:35 file1 -rw-r--r-- 1 root root 0 Сен 29 10:35 file2 -rw-r--r-- 1 root root 0 Сен 29 10:35 file3 -rw-r--r-- 1 root root 0 Сен 29 10:35 file4 -rw-r--r-- 1 root root 0 Сен 29 10:35 file5 -rw-r--r-- 1 root root 0 Сен 29 10:35 file7 -rw-r--r-- 1 root root 0 Сен 29 10:35 file9 -rw-r--r-- 1 root root 5268 Окт 13 2014 install -rwxr--r-- 1 root root 40 Сен 29 11:00 privet.sh -rw-r--r-- 1 root root 0 Сен 28 14:25 report -rw-r----- 1 root root 1029 Сен 28 14:23 shadow |
#cat errors
find: `/proc/10403/task/10403/fd/5': Нет такого файла или каталога find: `/proc/10403/task/10403/fdinfo/5': Нет такого файла или каталога find: `/proc/10403/fd/5': Нет такого файла или каталога find: `/proc/10403/fdinfo/5': Нет такого файла или каталога |
#find / -user ivan -type f 2> errors 1>files
|
#cat files
/tmp/users /home/ivan/.bashrc /home/ivan/.bash_history /home/ivan/.profile /home/ivan/d2/d3/d1/users /home/ivan/d2/users /home/ivan/.bash_logout /proc/8904/task/8904/fdinfo/0 /proc/8904/task/8904/fdinfo/1 /proc/8904/task/8904/fdinfo/2 ... /proc/8904/stack /proc/8904/cpuset /proc/8904/cgroup /proc/8904/oom_score /proc/8904/oom_adj /proc/8904/oom_score_adj /proc/8904/loginuid /proc/8904/sessionid /proc/8904/coredump_filter /proc/8904/io |
#find / -user ivan -type f &> all
|
#mail ivan
Subject: test Hello . EOT |
#shopt
autocd off cdable_vars off cdspell off checkhash off checkjobs off checkwinsize on cmdhist on compat31 off compat32 off compat40 off ... no_empty_cmd_completion off nocaseglob off nocasematch off nullglob off progcomp on promptvars on restricted_shell off shift_verbose off sourcepath on xpg_echo off |
#set -o nonoclobber
![]() l3script: set: nonoclobber: недопустимое имя опции |
#set -o no noclobber
![]() l3script: set: no: недопустимое имя опции |
#set -o noclobber
|
#find / -user ivan -type f &> all
![]() l3script: all: не могу переписать уже существующий файл |
#find / -user ivan -type f &> all
![]() |
#ls atrr
![]() ls: невозможно получить доступ к atrr: Нет такого файла или каталога |
#lsatrr
![]() l3script: lsatrr: команда не найдена |
#lsattr
-------------e-- ./errors -------------e-- ./file4 -------------e-- ./files -------------e-- ./file9 -------------e-- ./all -------------e-- ./shadow -------------e-- ./file1 -------------e-- ./report -------------e-- ./file5 -------------e-- ./file7 -------------e-- ./privet.sh -------------e-- ./file3 -------------e-- ./install -------------e-- ./file2 |
#chattr +a report
|
#lsattr
-------------e-- ./errors -------------e-- ./file4 -------------e-- ./files -------------e-- ./file9 -------------e-- ./all -------------e-- ./shadow -------------e-- ./file1 -----a-------e-- ./report -------------e-- ./file5 -------------e-- ./file7 -------------e-- ./privet.sh -------------e-- ./file3 -------------e-- ./install -------------e-- ./file2 |
#find / -user ivan -type f &> all
![]() |
#find / -user ivan -type f &> report
![]() l3script: report: Операция не позволяется |
#find / -user ivan -type f &>> report
![]() |
#chattr -i report
|
#chattr -i report
|
#lsattr
-------------e-- ./errors -------------e-- ./file4 -------------e-- ./files -------------e-- ./file9 -------------e-- ./all -------------e-- ./shadow -------------e-- ./file1 -------------e-- ./report -------------e-- ./file5 -------------e-- ./file7 -------------e-- ./privet.sh -------------e-- ./file3 -------------e-- ./install -------------e-- ./file2 |
#find / -user ivan -type f &>> report
|
#find / -user ivan -type f &>> report
l3script: report: Отказано в доступе |
#ls -1 f*
file1 file2 file3 file4 file5 file7 file9 files |
#ls -1 f* | sort -r
files file9 file7 file5 file4 file3 file2 file1 |
#ls -1 f* | rm -f
|
#ls f*
file1 file2 file3 file4 file5 file7 file9 files |
#ls -1 f* | xarg rm -f
![]() l3script: xarg: команда не найдена |
#ls -1 f* | xargs rm -f
|
#ls f*
![]() ls: невозможно получить доступ к f*: Нет такого файла или каталога |
#ls *
all errors install privet.sh report shadow |
#ls *
all errors install privet.sh report shadow |
#ls
all errors install privet.sh report shadow |
#cat install
#!/bin/sh hostname=`hostname` uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f` ############################################################################### # # Set this variables before installation: lilalo_user=13-10-2014 lab=NT-LNet install_l3bashrc_for_this_users=${users:-"root user"} # users who will use l3agent and l3script lilalo_context="/users/${lilalo_user}/${lab}/${hostname}" ... step "Downloading l3prompt" ${wget} ${url_l3prompt} step "Downloading l3-agent" '${wget} ${url_l3agent}; ${wget} ${url_l3config_pm}; ${wget} ${url_l3config}' step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }' step "Installing perl modules for l3-agent" '{ for i in ${perl_modules}; do tar xvfz $i.tar.gz; cd $i*[^z]; perl Makefile.PL; make; make install; cd ..; done; }' step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users cd / rm -rf ${temp_dir} show_final_message |
#cat install | gr
![]() grep grub-bin2h grub-mkpasswd-pbkdf2 groff grub-editenv grub-mkrelpath grog grub-fstest grub-mkrescue grops grub-install grub-mount grotty grub-kbdcomp grub-ntldr-img groupadd grub-menulst2cfg grub-probe groupdel grub-mkconfig grub-reboot groupmod grub-mkdevicemap grub-script-check groups grub-mkfont grub-set-default grpck grub-mkimage grub-setup grpconv grub-mklayout grpunconv grub-mknetdir |
#cat install | grep users
install_l3bashrc_for_this_users=${users:-"root user"} # users who will use l3agent and l3script lilalo_context="/users/${lilalo_user}/${lab}/${hostname}" install_to_users_homes() users="$@" for user in $users install_to_users_bashrc() users="$@" for user in $users install_to_users_bash_profile() users="$@" for user in $users step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users |
#cat install | grep -n users
12:install_l3bashrc_for_this_users=${users:-"root user"} # users who will use l3agent and l3script 13:lilalo_context="/users/${lilalo_user}/${lab}/${hostname}" 85:install_to_users_homes() 88: users="$@" 90: for user in $users 110:install_to_users_bashrc() 112: users="$@" 113: for user in $users 121:install_to_users_bash_profile() 123: users="$@" 124: for user in $users 178:step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users 179:step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users 180:step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users |
#cat install | grep -n users
12:install_l3bashrc_for_this_users=${users:-"root user"} # users who will use l3agent and l3script 13:lilalo_context="/users/${lilalo_user}/${lab}/${hostname}" 85:install_to_users_homes() 88: users="$@" 90: for user in $users 110:install_to_users_bashrc() 112: users="$@" 113: for user in $users 121:install_to_users_bash_profile() 123: users="$@" 124: for user in $users 178:step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users 179:step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users 180:step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users |
#cat install | grep -n users
12:install_l3bashrc_for_this_users=${users:-"root user"} # users who will use l3agent and l3script 13:lilalo_context="/users/${lilalo_user}/${lab}/${hostname}" 85:install_to_users_homes() 88: users="$@" 90: for user in $users 110:install_to_users_bashrc() 112: users="$@" 113: for user in $users 121:install_to_users_bash_profile() 123: users="$@" 124: for user in $users 178:step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users 179:step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users 180:step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users |
#cat install | grep -c users
14 |
#cat install | grep -n users
12:install_l3bashrc_for_this_users=${users:-"root user"} # users who will use l3agent and l3script 13:lilalo_context="/users/${lilalo_user}/${lab}/${hostname}" 85:install_to_users_homes() 88: users="$@" 90: for user in $users 110:install_to_users_bashrc() 112: users="$@" 113: for user in $users 121:install_to_users_bash_profile() 123: users="$@" 124: for user in $users 178:step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users 179:step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users 180:step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users |
#cat install | grep -c `users`
![]() grep: petr: Нет такого файла или каталога grep: root: Нет такого файла или каталога grep: user: Нет такого файла или каталога |
#cat install | grep -c 'users'
14 |
#cat install | grep -n 'users'
12:install_l3bashrc_for_this_users=${users:-"root user"} # users who will use l3agent and l3script 13:lilalo_context="/users/${lilalo_user}/${lab}/${hostname}" 85:install_to_users_homes() 88: users="$@" 90: for user in $users 110:install_to_users_bashrc() 112: users="$@" 113: for user in $users 121:install_to_users_bash_profile() 123: users="$@" 124: for user in $users 178:step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users 179:step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users 180:step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users |
#cat install | grep -n 'users
> cat install | grep -n 'users 12:install_l3bashrc_for_this_users=${users:-"root user"} # users who will use l3agent and l3script 13:lilalo_context="/users/${lilalo_user}/${lab}/${hostname}" 85:install_to_users_homes() 88: users="$@" 90: for user in $users 110:install_to_users_bashrc() 112: users="$@" 113: for user in $users 121:install_to_users_bash_profile() 123: users="$@" 124: for user in $users 178:step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users 179:step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users 180:step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users |
#cat install | grep -n 'users
' cat install | grep -n 'users 12:install_l3bashrc_for_this_users=${users:-"root user"} # users who will use l3agent and l3script 13:lilalo_context="/users/${lilalo_user}/${lab}/${hostname}" 85:install_to_users_homes() 88: users="$@" 90: for user in $users 110:install_to_users_bashrc() 112: users="$@" 113: for user in $users 121:install_to_users_bash_profile() 123: users="$@" 124: for user in $users 178:step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users 179:step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users 180:step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users |
#cat install | grep -n "users"
12:install_l3bashrc_for_this_users=${users:-"root user"} # users who will use l3agent and l3script 13:lilalo_context="/users/${lilalo_user}/${lab}/${hostname}" 85:install_to_users_homes() 88: users="$@" 90: for user in $users 110:install_to_users_bashrc() 112: users="$@" 113: for user in $users 121:install_to_users_bash_profile() 123: users="$@" 124: for user in $users 178:step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users 179:step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users 180:step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users |
#cat install | grep -n 'users$'
90: for user in $users 113: for user in $users 124: for user in $users 178:step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users 179:step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users 180:step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users |
#cat install | grep -c 'users$'
6 |
#cat install | grep -n 'users$'
90: for user in $users 113: for user in $users 124: for user in $users 178:step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users 179:step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users 180:step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users |
#cat install | grep -n -c '^$'
31 |
#cat install | grep -c '^$'
31 |
#cat install | grep -v '^$'
#!/bin/sh hostname=`hostname` uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f` ############################################################################### # # Set this variables before installation: lilalo_user=13-10-2014 lab=NT-LNet install_l3bashrc_for_this_users=${users:-"root user"} # users who will use l3agent and l3script lilalo_context="/users/${lilalo_user}/${lab}/${hostname}" ... step "Downloading l3prompt" ${wget} ${url_l3prompt} step "Downloading l3-agent" '${wget} ${url_l3agent}; ${wget} ${url_l3config_pm}; ${wget} ${url_l3config}' step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }' step "Installing perl modules for l3-agent" '{ for i in ${perl_modules}; do tar xvfz $i.tar.gz; cd $i*[^z]; perl Makefile.PL; make; make install; cd ..; done; }' step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users cd / rm -rf ${temp_dir} show_final_message |
#cat install | grep -c '^[abc]'
4 |
#cat install | grep -n '^[abc]'
30:apt_get_install_this="perl make libmodule-build-perl libc6-dev gcc" 40:apt_get_install_deps() 171:cd ${temp_dir} 181:cd / |
#cat install | grep -n -v '^[abc]'
1:#!/bin/sh 2: 3:hostname=`hostname` 4:uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f` 5: 6:############################################################################### 7:# 8:# Set this variables before installation: 9: 10:lilalo_user=13-10-2014 ... 175:step "Downloading l3-agent" '${wget} ${url_l3agent}; ${wget} ${url_l3config_pm}; ${wget} ${url_l3config}' 176:step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }' 177:step "Installing perl modules for l3-agent" '{ for i in ${perl_modules}; do tar xvfz $i.tar.gz; cd $i*[^z]; perl Makefile.PL; make; make install; cd ..; done; }' 178:step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users 179:step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users 180:step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users 182:rm -rf ${temp_dir} 183: 184:show_final_message 185: |
#cat install | grep -n '^[^abc]'
1:#!/bin/sh 3:hostname=`hostname` 4:uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f` 6:############################################################################### 7:# 8:# Set this variables before installation: 10:lilalo_user=13-10-2014 11:lab=NT-LNet 12:install_l3bashrc_for_this_users=${users:-"root user"} # users who will use l3agent and l3script 13:lilalo_context="/users/${lilalo_user}/${lab}/${hostname}" ... 173:step "Downloading l3bashrc" ${wget} ${url_l3bashrc} 174:step "Downloading l3prompt" ${wget} ${url_l3prompt} 175:step "Downloading l3-agent" '${wget} ${url_l3agent}; ${wget} ${url_l3config_pm}; ${wget} ${url_l3config}' 176:step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }' 177:step "Installing perl modules for l3-agent" '{ for i in ${perl_modules}; do tar xvfz $i.tar.gz; cd $i*[^z]; perl Makefile.PL; make; make install; cd ..; done; }' 178:step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users 179:step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users 180:step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users 182:rm -rf ${temp_dir} 184:show_final_message |
#cat install | grep -n '^[[:alpha:]]'
3:hostname=`hostname` 4:uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f` 10:lilalo_user=13-10-2014 11:lab=NT-LNet 12:install_l3bashrc_for_this_users=${users:-"root user"} # users who will use l3agent and l3script 13:lilalo_context="/users/${lilalo_user}/${lab}/${hostname}" 19:lilalo_rc=.l3rc 20:lilalo_home=.lilalo 21:url_lilalo="http://xgu.ru/lilalo" 22:url_l3bashrc="${url_lilalo}"/l3bashrc ... 174:step "Downloading l3prompt" ${wget} ${url_l3prompt} 175:step "Downloading l3-agent" '${wget} ${url_l3agent}; ${wget} ${url_l3config_pm}; ${wget} ${url_l3config}' 176:step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }' 177:step "Installing perl modules for l3-agent" '{ for i in ${perl_modules}; do tar xvfz $i.tar.gz; cd $i*[^z]; perl Makefile.PL; make; make install; cd ..; done; }' 178:step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users 179:step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users 180:step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users 181:cd / 182:rm -rf ${temp_dir} 184:show_final_message |
#cat install | grep -n '^[[:upper:]]'
135:Usage: 137:USAGE 145:Installation is successfully completed. 146:Now restart your shell or relogin 149:Your current lilalo context is ${lilalo_context}/USER 150:If you use xgu.ru backend, your labs will be available at 153:Use commands 158:For further information see http://xgu.ru/lilalo/ (in Russian). 160:Thank you gor using LiLaLo. 161:Happy Labbing! 165:FINAL_MESSAGE |
#cat install | grep -n '^[[:alnum:]]'
3:hostname=`hostname` 4:uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f` 10:lilalo_user=13-10-2014 11:lab=NT-LNet 12:install_l3bashrc_for_this_users=${users:-"root user"} # users who will use l3agent and l3script 13:lilalo_context="/users/${lilalo_user}/${lab}/${hostname}" 19:lilalo_rc=.l3rc 20:lilalo_home=.lilalo 21:url_lilalo="http://xgu.ru/lilalo" 22:url_l3bashrc="${url_lilalo}"/l3bashrc ... 174:step "Downloading l3prompt" ${wget} ${url_l3prompt} 175:step "Downloading l3-agent" '${wget} ${url_l3agent}; ${wget} ${url_l3config_pm}; ${wget} ${url_l3config}' 176:step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }' 177:step "Installing perl modules for l3-agent" '{ for i in ${perl_modules}; do tar xvfz $i.tar.gz; cd $i*[^z]; perl Makefile.PL; make; make install; cd ..; done; }' 178:step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users 179:step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users 180:step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users 181:cd / 182:rm -rf ${temp_dir} 184:show_final_message |
#cat install | grep -n '^[^[:alnum:]]'
1:#!/bin/sh 6:############################################################################### 7:# 8:# Set this variables before installation: 15:# 16:############################################################################### 41:{ 42: return 0 43: if which apt-get >& /dev/null 44: then ... 133:{ 134: cat <<USAGE 136: $0 138:} 141:{ 142: cat <<FINAL_MESSAGE 154: $ l3cd ${lilalo_context%/*/*}/MY-NEW-CONTEXT/${hostname}/USER 155: $ l3pwd 163:(don't forget to restart bash or relogin) 166:} |
#cat install | grep -n '^[[:alnum:]]'
3:hostname=`hostname` 4:uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f` 10:lilalo_user=13-10-2014 11:lab=NT-LNet 12:install_l3bashrc_for_this_users=${users:-"root user"} # users who will use l3agent and l3script 13:lilalo_context="/users/${lilalo_user}/${lab}/${hostname}" 19:lilalo_rc=.l3rc 20:lilalo_home=.lilalo 21:url_lilalo="http://xgu.ru/lilalo" 22:url_l3bashrc="${url_lilalo}"/l3bashrc ... 174:step "Downloading l3prompt" ${wget} ${url_l3prompt} 175:step "Downloading l3-agent" '${wget} ${url_l3agent}; ${wget} ${url_l3config_pm}; ${wget} ${url_l3config}' 176:step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }' 177:step "Installing perl modules for l3-agent" '{ for i in ${perl_modules}; do tar xvfz $i.tar.gz; cd $i*[^z]; perl Makefile.PL; make; make install; cd ..; done; }' 178:step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users 179:step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users 180:step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users 181:cd / 182:rm -rf ${temp_dir} 184:show_final_message |
#cat install | grep -n '^[^[:alnum:]]'
1:#!/bin/sh 6:############################################################################### 7:# 8:# Set this variables before installation: 15:# 16:############################################################################### 41:{ 42: return 0 43: if which apt-get >& /dev/null 44: then ... 133:{ 134: cat <<USAGE 136: $0 138:} 141:{ 142: cat <<FINAL_MESSAGE 154: $ l3cd ${lilalo_context%/*/*}/MY-NEW-CONTEXT/${hostname}/USER 155: $ l3pwd 163:(don't forget to restart bash or relogin) 166:} |
#cat install | grep -n '^[^[:alnum:]]'
1:#!/bin/sh 6:############################################################################### 7:# 8:# Set this variables before installation: 15:# 16:############################################################################### 41:{ 42: return 0 43: if which apt-get >& /dev/null 44: then ... 133:{ 134: cat <<USAGE 136: $0 138:} 141:{ 142: cat <<FINAL_MESSAGE 154: $ l3cd ${lilalo_context%/*/*}/MY-NEW-CONTEXT/${hostname}/USER 155: $ l3pwd 163:(don't forget to restart bash or relogin) 166:} |
#cat install | grep -n '^.[[:alnum:]]'
3:hostname=`hostname` 4:uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f` 10:lilalo_user=13-10-2014 11:lab=NT-LNet 12:install_l3bashrc_for_this_users=${users:-"root user"} # users who will use l3agent and l3script 13:lilalo_context="/users/${lilalo_user}/${lab}/${hostname}" 19:lilalo_rc=.l3rc 20:lilalo_home=.lilalo 21:url_lilalo="http://xgu.ru/lilalo" 22:url_l3bashrc="${url_lilalo}"/l3bashrc ... 174:step "Downloading l3prompt" ${wget} ${url_l3prompt} 175:step "Downloading l3-agent" '${wget} ${url_l3agent}; ${wget} ${url_l3config_pm}; ${wget} ${url_l3config}' 176:step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }' 177:step "Installing perl modules for l3-agent" '{ for i in ${perl_modules}; do tar xvfz $i.tar.gz; cd $i*[^z]; perl Makefile.PL; make; make install; cd ..; done; }' 178:step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users 179:step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users 180:step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users 181:cd / 182:rm -rf ${temp_dir} 184:show_final_message |
#cat install | grep -n '^.[[f-k]]'
![]() |
#cat install | grep -n '^.[f-k]'
10:lilalo_user=13-10-2014 13:lilalo_context="/users/${lilalo_user}/${lab}/${hostname}" 19:lilalo_rc=.l3rc 20:lilalo_home=.lilalo 32:wget=wget 36:whiteC='\033[1;37m' 132:show_usage() 140:show_final_message() 150:If you use xgu.ru backend, your labs will be available at 160:Thank you gor using LiLaLo. 170:mkdir -p ${temp_dir} 184:show_final_message |
#cat install | grep 'xgu\.ru'
url_lilalo="http://xgu.ru/lilalo" If you use xgu.ru backend, your labs will be available at http://xgu.ru/l3/${lilalo_context} For further information see http://xgu.ru/lilalo/ (in Russian). |
#cat install | grep 'ht+p'
![]() |
#cat install | grep -E 'ht+p'
url_lilalo="http://xgu.ru/lilalo" http://xgu.ru/l3/${lilalo_context} For further information see http://xgu.ru/lilalo/ (in Russian). |
#cat install | egrep 'ht+p'
url_lilalo="http://xgu.ru/lilalo" http://xgu.ru/l3/${lilalo_context} For further information see http://xgu.ru/lilalo/ (in Russian). |
#ls -l which egrep
![]() ls: невозможно получить доступ к which: Нет такого файла или каталога ls: невозможно получить доступ к egrep: Нет такого файла или каталога |
#ls -l `which egrep`
-rwxr-xr-x 1 root root 175456 Май 13 2012 /bin/egrep |
#ls -l `which grep`
-rwxr-xr-x 1 root root 175488 Май 13 2012 /bin/grep |
#mAN GREP
![]() l3script: mAN: команда не найдена |
#man grep
|
#cat install | egrep 'ht*p'
url_lilalo="http://xgu.ru/lilalo" http://xgu.ru/l3/${lilalo_context} For further information see http://xgu.ru/lilalo/ (in Russian). |
#cat install | egrep 'ht?p'
![]() |
#cat install | egrep 'htt?p'
url_lilalo="http://xgu.ru/lilalo" http://xgu.ru/l3/${lilalo_context} For further information see http://xgu.ru/lilalo/ (in Russian). |
#cat install | egrep 'ht{2}p'
url_lilalo="http://xgu.ru/lilalo" http://xgu.ru/l3/${lilalo_context} For further information see http://xgu.ru/lilalo/ (in Russian). |
#cat install | egrep 'ht{2-5}p'
![]() |
#cat install | egrep 'ht{2,5}p'
url_lilalo="http://xgu.ru/lilalo" http://xgu.ru/l3/${lilalo_context} For further information see http://xgu.ru/lilalo/ (in Russian). |
[4] 10325 [4]+ Stopped cat
find: `/proc/10403/task/10403/fd/5': Нет такого файла или каталога find: `/proc/10403/task/10403/fdinfo/5': Нет такого файла или каталога find: `/proc/10403/fd/5': Нет такого файла или каталога find: `/proc/10403/fdinfo/5': Нет такого файла или каталога
/tmp/users /home/ivan/.bashrc /home/ivan/.bash_history /home/ivan/.profile /home/ivan/d2/d3/d1/users /home/ivan/d2/users /home/ivan/.bash_logout /proc/8904/task/8904/fdinfo/0 /proc/8904/task/8904/fdinfo/1 /proc/8904/task/8904/fdinfo/2 /proc/8904/task/8904/fdinfo/3 /proc/8904/task/8904/fdinfo/4 /proc/8904/task/8904/fdinfo/5 /proc/8904/task/8904/fdinfo/255 /proc/8904/task/8904/ns/net /proc/8904/task/8904/ns/uts /proc/8904/task/8904/ns/ipc /proc/8904/task/8904/environ /proc/8904/task/8904/auxv /proc/8904/task/8904/status /proc/8904/task/8904/personality /proc/8904/task/8904/limits /proc/8904/task/8904/sched /proc/8904/task/8904/comm /proc/8904/task/8904/syscall /proc/8904/task/8904/cmdline /proc/8904/task/8904/stat /proc/8904/task/8904/statm /proc/8904/task/8904/maps /proc/8904/task/8904/numa_maps /proc/8904/task/8904/mem /proc/8904/task/8904/mounts /proc/8904/task/8904/mountinfo /proc/8904/task/8904/clear_refs /proc/8904/task/8904/smaps /proc/8904/task/8904/pagemap /proc/8904/task/8904/attr/current /proc/8904/task/8904/attr/prev /proc/8904/task/8904/attr/exec /proc/8904/task/8904/attr/fscreate /proc/8904/task/8904/attr/keycreate /proc/8904/task/8904/attr/sockcreate /proc/8904/task/8904/wchan /proc/8904/task/8904/stack /proc/8904/task/8904/cpuset /proc/8904/task/8904/cgroup /proc/8904/task/8904/oom_score /proc/8904/task/8904/oom_adj /proc/8904/task/8904/oom_score_adj /proc/8904/task/8904/loginuid /proc/8904/task/8904/sessionid /proc/8904/task/8904/io /proc/8904/fdinfo/0 /proc/8904/fdinfo/1 /proc/8904/fdinfo/2 /proc/8904/fdinfo/3 /proc/8904/fdinfo/4 /proc/8904/fdinfo/5 /proc/8904/fdinfo/255 /proc/8904/ns/net /proc/8904/ns/uts /proc/8904/ns/ipc /proc/8904/environ /proc/8904/auxv /proc/8904/status /proc/8904/personality /proc/8904/limits /proc/8904/sched /proc/8904/autogroup /proc/8904/comm /proc/8904/syscall /proc/8904/cmdline /proc/8904/stat /proc/8904/statm /proc/8904/maps /proc/8904/numa_maps /proc/8904/mem /proc/8904/mounts /proc/8904/mountinfo /proc/8904/mountstats /proc/8904/clear_refs /proc/8904/smaps /proc/8904/pagemap /proc/8904/attr/current /proc/8904/attr/prev /proc/8904/attr/exec /proc/8904/attr/fscreate /proc/8904/attr/keycreate /proc/8904/attr/sockcreate /proc/8904/wchan /proc/8904/stack /proc/8904/cpuset /proc/8904/cgroup /proc/8904/oom_score /proc/8904/oom_adj /proc/8904/oom_score_adj /proc/8904/loginuid /proc/8904/sessionid /proc/8904/coredump_filter /proc/8904/io
#!/bin/sh hostname=`hostname` uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f` ############################################################################### # # Set this variables before installation: lilalo_user=13-10-2014 lab=NT-LNet install_l3bashrc_for_this_users=${users:-"root user"} # users who will use l3agent and l3script lilalo_context="/users/${lilalo_user}/${lab}/${hostname}" # ############################################################################### lilalo_rc=.l3rc lilalo_home=.lilalo url_lilalo="http://xgu.ru/lilalo" url_l3bashrc="${url_lilalo}"/l3bashrc url_l3agent="${url_lilalo}"/l3-agent url_l3config_pm="${url_lilalo}"/l3config.pm url_l3config="${url_lilalo}"/l3-config url_l3prompt="${url_lilalo}"/l3prompt url_perl_modules=${url_lilalo}/ perl_modules="Term-VT102 Text-Iconv" apt_get_install_this="perl make libmodule-build-perl libc6-dev gcc" wget=wget uname -a | egrep -qi '(bsd|darwin)' && wget=fetch normC='\033[0;39m' whiteC='\033[1;37m' redC='\033[0;31m' greenC='\033[0;32m' apt_get_install_deps() { return 0 if which apt-get >& /dev/null then apt-get install -y $apt_get_install_this else echo "Please install this dependencies manually:" echo $apt_get_install_this echo "Have you installed this already (y/n)?" echo y | read answer if echo $answer | grep -q ^[yY] then true else echo Please install the dependencies and rerun the script exit 1 fi fi } step() { msg="$1" shift printf "${whiteC}""$msg""...${normC}\n" # eval "$@" 2>&1 | sed 's/^/|\ \ \ /' && printf "Ok\n" || printf "Failed\n" eval "$@" 2>&1 > log 2>&1 && \ { cat log | sed 's/^/|\ \ \ /' printf "${greenC}""Ok\n""${normC}" } || \ { cat log | sed 's/^/|\ \ \ /' printf "${redC}""Failed\n""${normC}" } } get_user_home() { uname -a | egrep -qi '(freebsd|darwin)' && pw user show "$@"| awk -F: '{print $9}' || getent passwd "$@"| awk -F: '{print $6}' } install_to_users_homes() { . l3bashrc users="$@" set -x for user in $users do user_home=`get_user_home "$user"` mkdir -p ${user_home}/${lilalo_home} mkdir /etc/lilalo/ cp l3config.pm /etc/lilalo/ cp l3-agent /usr/local/bin cp l3-config /usr/local/bin ln -s `which bash` /usr/local/bin/l3script chmod 755 /usr/local/bin/l3-{agent,config} cp l3bashrc ${user_home}/${lilalo_home} cp l3prompt ${user_home}/${lilalo_home} chmod 755 ${user_home}/${lilalo_home}/l3prompt chown -R $user ${user_home}/${lilalo_home} echo l3cd=${lilalo_context}/$user > ${user_home}/${lilalo_rc} chown -R $user ${user_home}/${lilalo_rc} done set +x } install_to_users_bashrc() { users="$@" for user in $users do user_home=`get_user_home "$user"` grep -q lilalo ${user_home}/.bashrc 2> /dev/null\ || echo "[ \$0 == l3script ] && . ${user_home}/.lilalo/l3bashrc && _l3_start" >> ${user_home}/.bashrc; chown -R ${user} ${user_home}/.bashrc done } install_to_users_bash_profile() { users="$@" for user in $users do user_home=`get_user_home "$user"` grep -q l3-agent ${user_home}/.bash_profile 2> /dev/null \ || { echo >> ${user_home}/.bash_profile ; cat ${user_home}/.bash_profile | sed '1s/^/l3-agentX/' | tr X '\n' > /tmp/$$$$l3 ; mv /tmp/$$$$l3 ${user_home}/.bash_profile; chown -R ${user} ${user_home}/.bash_profile; } done } show_usage() { cat <<USAGE Usage: $0 USAGE } show_final_message() { cat <<FINAL_MESSAGE Installation is successfully completed. Now restart your shell or relogin to start script writing. Your current lilalo context is ${lilalo_context}/USER If you use xgu.ru backend, your labs will be available at http://xgu.ru/l3/${lilalo_context} Use commands $ l3cd ${lilalo_context%/*/*}/MY-NEW-CONTEXT/${hostname}/USER $ l3pwd to change and to know your current context. For further information see http://xgu.ru/lilalo/ (in Russian). Thank you gor using LiLaLo. Happy Labbing! (don't forget to restart bash or relogin) FINAL_MESSAGE } temp_dir=/tmp/lilalo-install-temp-$$ mkdir -p ${temp_dir} cd ${temp_dir} step "Installing dependencies" apt_get_install_deps step "Downloading l3bashrc" ${wget} ${url_l3bashrc} step "Downloading l3prompt" ${wget} ${url_l3prompt} step "Downloading l3-agent" '${wget} ${url_l3agent}; ${wget} ${url_l3config_pm}; ${wget} ${url_l3config}' step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }' step "Installing perl modules for l3-agent" '{ for i in ${perl_modules}; do tar xvfz $i.tar.gz; cd $i*[^z]; perl Makefile.PL; make; make install; cd ..; done; }' step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users cd / rm -rf ${temp_dir} show_final_message
Время первой команды журнала | 10:15:17 2015- 9-29 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 13:25:08 2015- 9-29 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 101 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 14.85 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 2.97 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 1.19 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 1.42 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду 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