/l3/users/27-11-2017/NT-Ladm/debian4.net.nt/root :1 :2 :3 :4 :5 |
|
#> 233455
|
#> 23weqrg435
|
#> 23weqrg43544rrrr
|
#> 23weqrg43544rrrrwe23
|
#>wew34234rtert453
|
#ls
233455 2342 23422 234223452 2342234525534 2342234525534566 23weqrg435 23weqrg43544rrrr 23weqrg43544rrrrwe23 install test.java wew34234rtert453 |
#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 |
#shopt -s extglob
|
#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 |
#ls + ([[:digit:]])
![]() l3script: syntax error near unexpected token `(' |
#ls +([[:digit:]])
233455 2342 23422 234223452 2342234525534 2342234525534566 |
#cd
|
#touch f(1,2,3,4,5)
![]() l3script: syntax error near unexpected token `(' |
#touch f{1,2,3,4,5}
|
#ls
233455 2342 23422 234223452 2342234525534 2342234525534566 23weqrg435 23weqrg43544rrrr 23weqrg43544rrrrwe23 f1 f2 f3 f4 f5 install test.java wew34234rtert453 |
#rm f{1,2,3,4,5}
|
#ls
233455 2342 23422 234223452 2342234525534 2342234525534566 23weqrg435 23weqrg43544rrrr 23weqrg43544rrrrwe23 install test.java wew34234rtert453 |
#touch f{1,2,3,4,5}
|
#touch f{1,2,3,4,5} | za
![]() l3script: za: команда не найдена |
#touch f{1,2,3,4,5} | xargs -i cp -v() /tmp/
![]() l3script: syntax error near unexpected token `(' |
#touch f{1,2,3,4,5} | xargs -i cp -v{} /tmp/
|
#whi
![]() which while whiptail |
#which who
/usr/bin/who |
#ls -l /usr/bin/wh
![]() whatis whereis which whiptail who whoami |
#ls -l /usr/bin/who
-rwxr-xr-x 1 root root 55888 Янв 26 2013 /usr/bin/who |
#ls -l 'which who'
![]() ls: невозможно получить доступ к which who: Нет такого файла или каталога |
#ls -l `which who`
-rwxr-xr-x 1 root root 55888 Янв 26 2013 /usr/bin/who |
#echo $[5+8]
13 |
#ps ax | wc -l
61 |
#top
top - 12:26:07 up 3 days, 20:38, 3 users, load average: 0,24, 0,06, 0,06 Tasks: 59 total, 1 running, 58 sleeping, 0 stopped, 0 zombie %Cpu(s): 0,0 us, 0,3 sy, 0,0 ni, 99,7 id, 0,0 wa, 0,0 hi, 0,0 si, 0,0 st KiB Mem: 507368 total, 292316 used, 215052 free, 86904 buffers KiB Swap: 0 total, 0 used, 0 free, 112004 cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 7778 root 20 0 18168 468 308 S 0,3 0,1 0:00.03 script 1 root 20 0 10648 828 696 S 0,0 0,2 0:06.23 init 2 root 20 0 0 0 0 S 0,0 0,0 0:00.00 kthreadd 3 root 20 0 0 0 0 S 0,0 0,0 0:01.81 ksoftirqd/0 ... 3927 user 20 0 48096 10m 1716 S 0,0 2,1 2:27.56 l3-agent 7700 root 20 0 71380 3788 2892 R 0,0 0,7 0:00.21 sshd 7702 root 20 0 22168 2860 1720 S 0,0 0,6 0:00.04 bash 7747 root 20 0 18164 840 688 S 0,0 0,2 0:00.02 script 7778 root 20 0 18168 468 308 S 0,0 0,1 0:00.05 script 7779 root 20 0 21652 2364 1740 S 0,0 0,5 0:00.33 l3script 7944 root 20 0 71380 3720 2824 S 0,0 0,7 0:00.04 sshd 7946 user 20 0 71380 1976 1080 S 0,0 0,4 0:00.01 sshd 7947 user 20 0 24260 2932 1756 S 0,0 0,6 0:00.05 bash 7993 user 20 0 18164 840 684 S 0,0 0,2 0:00.05 script |
#$[$(ps ax | wc -l)-2]
![]() l3script: 60: команда не найдена |
#echo $[$(ps ax | wc -l)-4]
58 |
#echo $[$(ps ax | wc -l)-4]
58 |
#zsh
|
#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 | cat
#!/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
![]() test test Privat Privat ^C |
#cat help
![]() cat: help: Нет такого файла или каталога |
#cat --help
ÐÑполÑзование: cat [ÐÐФÐÐÐ ²Ð²Ð¾Ð´ и оÑпÑавлÑÐµÑ Ð² ÑÑандаÑÑнÑй вÑвод. -A, --show-all Ñиноним -vET -b, --number-nonblank нÑмеÑоваÑÑ Ð½ÐµÐ¿ÑÑÑÑе ÑÑÑоки пÑи вÑводе -e подавлÑÐµÑ -n, Ñиноним -vE -E, --show-ends показÑваÑÑ $ в конÑе каждой ÑÑÑоки -n, --number нÑмеÑоваÑÑ Ð²Ñе ÑÑÑоки пÑи вÑводе -s, --squeeze-blank вÑводиÑÑ Ð½Ðµ более одной пÑÑÑой ÑÑÑоки пÑи повÑоÑе -t Ñиноним -vT -T, --show-tabs показÑваÑÑ Ñимволов ÑабÑлÑÑии как ^I ... --version показаÑÑ Ð¸Ð½ÑоÑмаÑÐ¸Ñ Ð¾ веÑÑии и вÑйÑи ÐÑли ФÐÐндаÑÑнÑй ввод. ÐÑимеÑÑ: cat f - g ÐÑÐ²Ð¾Ð´Ð¸Ñ ÑодеÑжимое f, поÑом ÑÑандаÑÑнÑй ввод, поÑом g. cat ÐопиÑÑÐµÑ ÑÑандаÑÑнÑй ввод на ÑÑандаÑÑнÑй вÑвод. Ðб оÑÐ¸Ð±ÐºÐ°Ñ Ð² cat ÑообÑайÑе по адÑеÑÑ bug-coreutils@gnu.org. ÐомаÑнÑÑ ÑÑÑаниÑа GNU coreutils: <http://www.gnu.org/software/coreutils/> СпÑавка по ÑабоÑе Ñ Ð¿ÑогÑаммами GNU: <http://www.gnu.org/gethelp/> Ðб оÑÐ¸Ð±ÐºÐ°Ñ Ð² пеÑеводе ÑообÑений «cat» ÑообÑайÑе по адÑеÑÑ <gnu@mx.ru> ÐÐ¾Ð»Ð½Ð°Ñ Ð´Ð¾ÐºÑменÑаÑÐ¸Ñ Ð´Ð¾ÑÑÑпна по команде: info coreutils 'cat invocation' |
#top
top - 12:45:23 up 3 days, 20:58, 3 users, load average: 0,00, 0,01, 0,05 Tasks: 59 total, 1 running, 58 sleeping, 0 stopped, 0 zombie %Cpu(s): 0,1 us, 0,0 sy, 0,0 ni, 99,8 id, 0,1 wa, 0,0 hi, 0,0 si, 0,0 st KiB Mem: 507368 total, 293060 used, 214308 free, 87340 buffers KiB Swap: 0 total, 0 used, 0 free, 112164 cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 1 root 20 0 10648 828 696 S 0,0 0,2 0:06.24 init 2 root 20 0 0 0 0 S 0,0 0,0 0:00.00 kthreadd 3 root 20 0 0 0 0 S 0,0 0,0 0:01.82 ksoftirqd/0 5 root 20 0 0 0 0 S 0,0 0,0 0:00.00 kworker/u:0 ... 3927 user 20 0 48096 10m 1716 S 0,0 2,1 2:27.81 l3-agent 7700 root 20 0 71380 3788 2892 S 0,0 0,7 0:00.26 sshd 7702 root 20 0 22168 2860 1720 S 0,0 0,6 0:00.04 bash 7747 root 20 0 18164 840 688 S 0,0 0,2 0:00.03 script 7778 root 20 0 18168 468 308 S 0,0 0,1 0:00.08 script 7779 root 20 0 21652 2364 1740 S 0,0 0,5 0:00.40 l3script 7944 root 20 0 71380 3720 2824 S 0,0 0,7 0:00.04 sshd 7946 user 20 0 71380 1976 1080 S 0,0 0,4 0:00.01 sshd 7947 user 20 0 24260 2932 1756 S 0,0 0,6 0:00.05 bash 7993 user 20 0 18164 840 684 S 0,0 0,2 0:00.05 script |
#top
top - 12:46:00 up 3 days, 20:58, 3 users, load average: 0,00, 0,01, 0,05 Tasks: 59 total, 1 running, 58 sleeping, 0 stopped, 0 zombie %Cpu(s): 0,0 us, 0,0 sy, 0,0 ni,100,0 id, 0,0 wa, 0,0 hi, 0,0 si, 0,0 st KiB Mem: 507368 total, 293060 used, 214308 free, 87356 buffers KiB Swap: 0 total, 0 used, 0 free, 112196 cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 7700 root 20 0 71380 3788 2892 S 0,3 0,7 0:00.27 sshd 8712 root 20 0 25288 1580 1128 R 0,3 0,3 0:00.01 top 1 root 20 0 10648 828 696 S 0,0 0,2 0:06.24 init 2 root 20 0 0 0 0 S 0,0 0,0 0:00.00 kthreadd ... 2288 root 20 0 18368 972 812 S 0,0 0,2 0:00.00 getty 2289 root 20 0 18368 972 812 S 0,0 0,2 0:00.00 getty 2290 root 20 0 18368 972 812 S 0,0 0,2 0:00.00 getty 2291 root 20 0 18368 968 812 S 0,0 0,2 0:00.00 getty 2292 root 20 0 18368 972 812 S 0,0 0,2 0:00.00 getty 3358 root 20 0 0 0 0 S 0,0 0,0 0:00.75 flush-202:0 3401 root 20 0 47876 10m 1724 S 0,0 2,1 3:04.82 l3-agent 7702 root 20 0 22168 2860 1720 S 0,0 0,6 0:00.04 bash 7747 root 20 0 18164 840 688 S 0,0 0,2 0:00.03 script 7778 root 20 0 18168 468 308 S 0,0 0,1 0:00.09 script |
#find / -mtime -1-user ivan
![]() find: неверный аргумент `ivan' у `-mtime' |
#find / -mtime -1 -user ivan
![]() /home/ivan /home/ivan/.bash_history find: `/proc/8730/task/8730/fd/5': Нет такого файла или каталога find: `/proc/8730/task/8730/fdinfo/5': Нет такого файла или каталога find: `/proc/8730/fd/5': Нет такого файла или каталога find: `/proc/8730/fdinfo/5': Нет такого файла или каталога |
#find /home -mtime -1 -user ivan
/home/ivan /home/ivan/.bash_history |
#find /home -mtime -1 -user ivan > file.txt
|
#cat file.txt
/home/ivan /home/ivan/.bash_history |
#su -ivan
![]() su: невеÑнÑй клÑÑ -- «i» ÐÑполÑзование: su [паÑамеÑÑÑ] [ÐÐÐ , --command ÐÐÐÐÐÐРпеÑедаÑÑ ÐÐÐÐÐÐУ вÑзÑваемой оболоÑке -h, --help показаÑÑ Ð´Ð°Ð½Ð½Ð¾Ðµ ÑообÑение и законÑиÑÑ ÑабоÑÑ -, -l, --login запÑÑкаÑÑ Ð¾Ð±Ð¾Ð»Ð¾ÑÐºÑ ÐºÐ°Ðº ÑегиÑÑÑаÑионнÑÑ -m, -p, --preserve-environment не ÑбÑаÑÑваÑÑ Ð¿ÐµÑеменнÑе окÑÑÐ¶ÐµÐ½Ð¸Ñ Ð¸ ÑÐ¾Ñ ÑаниÑÑ Ð·Ð°Ð¿ÑÑÑивÑÑÑ Ð¾Ð±Ð¾Ð»Ð¾ÑÐºÑ -s, --shell ÐÐÐРвмеÑÑо знаÑÐµÐ½Ð¸Ñ Ð¸Ð· Ñайла passwd |
#su - ivan
![]() ivan@debian4:~$ find /home -mtime -1 -user ivan > file.txt ivan@debian4:~$ find / -mtime -1 -user ivan > file.txt find: `/etc/ssl/private': Отказано в доступе find: `/lost+found': Отказано в доступе find: `/var/cache/ldconfig': Отказано в доступе find: `/var/spool/exim4': Отказано в доступе find: `/var/spool/cron/crontabs': Отказано в доступе find: `/var/log/exim4': Отказано в доступе find: `/var/log/iptraf': Отказано в доступе find: `/run/exim4': Отказано в доступе ... find: `/proc/8778/fd': Отказано в доступе find: `/proc/8778/fdinfo': Отказано в доступе find: `/proc/8778/ns': Отказано в доступе find: `/proc/8861/task/8861/fd/5': Нет такого файла или каталога find: `/proc/8861/task/8861/fdinfo/5': Нет такого файла или каталога find: `/proc/8861/fd/5': Нет такого файла или каталога find: `/proc/8861/fdinfo/5': Нет такого файла или каталога ivan@debian4:~$ find / -mtime -1 -user ivan > file.txt 2> errors.txt ivan@debian4:~$ exit logout |
#clean
![]() l3script: clean: команда не найдена |
#clear
|
#shop set -o
![]() l3script: shop: команда не найдена |
#set -o noclobber
|
#data >> install
![]() l3script: data: команда не найдена |
#date >> install
|
#set +o noclobber
|
#lsattr install
-------------e-- install |
#chattr +a install
|
#lsattr install
-----a-------e-- install |
#chattr -a install
|
#chattr +i install
|
#lsattr install
----i--------e-- install |
#date >> install
![]() l3script: install: Отказано в доступе |
#chattr -i install
|
#lsattr install
-------------e-- install |
#ps uax | sort -k4 -r | head -11
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND user 3927 0.1 2.1 48096 10836 ? Ss Ноя27 2:29 l3-agent root 3401 0.2 2.0 47876 10556 ? Ss Ноя27 3:17 l3-agent root 7700 0.0 0.7 71380 3788 ? Ss 10:07 0:00 sshd: root@pts/0 root 7944 0.0 0.7 71380 3720 ? Ss 10:19 0:00 sshd: user [priv] root 8267 0.0 0.7 71288 3680 ? Ss 10:59 0:00 sshd: root@pts/4 root 8269 0.0 0.6 24308 3080 pts/4 Ss+ 10:59 0:00 -bash user 7947 0.0 0.5 24260 2932 pts/2 Ss 10:19 0:00 -bash user 8065 0.0 0.5 22260 3044 pts/3 Ss+ 10:20 0:00 l3script root 7702 0.0 0.5 22168 2860 pts/0 Ss 10:07 0:00 -bash root 7779 0.0 0.4 21656 2368 pts/1 Ss 10:07 0:00 l3script |
#ls
233455 2342 23422 234223452 2342234525534 2342234525534566 23weqrg435 23weqrg43544rrrr 23weqrg43544rrrrwe23 f1 f2 f3 f4 f5 file.txt install test.java wew34234rtert453 |
#ls [0-9]* | rm
![]() rm: пропущен операнд Попробуйте «rm --help» для получения более подробного описания. |
#ls [0-9]* | xargs rm
|
#ls
f1 f2 f3 f4 f5 file.txt install test.java wew34234rtert453 |
#ps uax | sort -k4 -r | head -11
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND user 3927 0.1 2.1 48096 10836 ? Ss Ноя27 2:29 l3-agent root 3401 0.2 2.0 47876 10556 ? Ss Ноя27 3:19 l3-agent root 7700 0.0 0.7 71380 3788 ? Ss 10:07 0:00 sshd: root@pts/0 root 7944 0.0 0.7 71380 3720 ? Ss 10:19 0:00 sshd: user [priv] root 8267 0.0 0.7 71288 3680 ? Ss 10:59 0:00 sshd: root@pts/4 root 8269 0.0 0.6 24308 3080 pts/4 Ss+ 10:59 0:00 -bash user 7947 0.0 0.5 24260 2932 pts/2 Ss 10:19 0:00 -bash user 8065 0.0 0.5 22260 3044 pts/3 Ss+ 10:20 0:00 l3script root 7702 0.0 0.5 22168 2860 pts/0 Ss 10:07 0:00 -bash root 7779 0.0 0.4 21656 2368 pts/1 Ss 10:07 0:00 l3script |
#ps uax | sort -k4 -r | tee proc.txt | head -11
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND user 3927 0.1 2.1 48096 10836 ? Ss Ноя27 2:29 l3-agent root 3401 0.2 2.0 47876 10556 ? Ss Ноя27 3:19 l3-agent root 7700 0.0 0.7 71380 3788 ? Ss 10:07 0:00 sshd: root@pts/0 root 7944 0.0 0.7 71380 3720 ? Ss 10:19 0:00 sshd: user [priv] root 8267 0.0 0.7 71288 3680 ? Ss 10:59 0:00 sshd: root@pts/4 root 8269 0.0 0.6 24308 3080 pts/4 Ss+ 10:59 0:00 -bash user 7947 0.0 0.5 24260 2932 pts/2 Ss 10:19 0:00 -bash user 8065 0.0 0.5 22260 3044 pts/3 Ss+ 10:20 0:00 l3script root 7702 0.0 0.5 22168 2860 pts/0 Ss 10:07 0:00 -bash root 7779 0.0 0.4 21656 2368 pts/1 Ss 10:07 0:00 l3script |
#cat proc.txt
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND user 3927 0.1 2.1 48096 10836 ? Ss Ноя27 2:29 l3-agent root 3401 0.2 2.0 47876 10556 ? Ss Ноя27 3:19 l3-agent root 7700 0.0 0.7 71380 3788 ? Ss 10:07 0:00 sshd: root@pts/0 root 7944 0.0 0.7 71380 3720 ? Ss 10:19 0:00 sshd: user [priv] root 8267 0.0 0.7 71288 3680 ? Ss 10:59 0:00 sshd: root@pts/4 root 8269 0.0 0.6 24308 3080 pts/4 Ss+ 10:59 0:00 -bash user 7947 0.0 0.5 24260 2932 pts/2 Ss 10:19 0:00 -bash user 8065 0.0 0.5 22260 3044 pts/3 Ss+ 10:20 0:00 l3script root 7702 0.0 0.5 22168 2860 pts/0 Ss 10:07 0:00 -bash ... root 9 0.0 0.0 0 0 ? S< Ноя24 0:00 [khelper] root 10 0.0 0.0 0 0 ? S Ноя24 0:00 [kdevtmpfs] root 17 0.0 0.0 0 0 ? S< Ноя24 0:00 [kblockd] root 22 0.0 0.0 0 0 ? S Ноя24 0:00 [fsnotify_mark] root 128 0.0 0.0 0 0 ? S< Ноя24 0:00 [ext4-dio-unwrit] root 23 0.0 0.0 0 0 ? S< Ноя24 0:00 [crypto] root 8 0.0 0.0 0 0 ? S< Ноя24 0:00 [cpuset] root 15 0.0 0.0 0 0 ? S Ноя24 0:00 [bdi-default] root 87 0.0 0.0 0 0 ? S< Ноя24 0:00 [ata_sff] root 21 0.0 0.0 0 0 ? SN Ноя24 0:00 [ksmd] |
#clean
![]() l3script: clean: команда не найдена |
#clear
|
#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 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 Втр Ноя 28 13:49:28 EET 2017 |
#cat install | grep rm
perl_modules="Term-VT102 Text-Iconv" normC='\033[0;39m' printf "${whiteC}""$msg""...${normC}\n" printf "${greenC}""Ok\n""${normC}" printf "${redC}""Failed\n""${normC}" For further information see http://xgu.ru/lilalo/ (in Russian). rm -rf ${temp_dir} |
#cat install | grep ^rm
rm -rf ${temp_dir} |
#cat install | grep '^rm'
rm -rf ${temp_dir} |
#cat install | grep '"'
install_l3bashrc_for_this_users=${users:-"root user"} # users who will use l3agent and l3script lilalo_context="/users/${lilalo_user}/${lab}/${hostname}" 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 perl_modules="Term-VT102 Text-Iconv" apt_get_install_this="perl make libmodule-build-perl libc6-dev gcc" ... user_home=`get_user_home "$user"` 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 |
#cat install | grep '"' | nl
1 install_l3bashrc_for_this_users=${users:-"root user"} # users who will use l3agent and l3script 2 lilalo_context="/users/${lilalo_user}/${lab}/${hostname}" 3 url_lilalo="http://xgu.ru/lilalo" 4 url_l3bashrc="${url_lilalo}"/l3bashrc 5 url_l3agent="${url_lilalo}"/l3-agent 6 url_l3config_pm="${url_lilalo}"/l3config.pm 7 url_l3config="${url_lilalo}"/l3-config 8 url_l3prompt="${url_lilalo}"/l3prompt 9 perl_modules="Term-VT102 Text-Iconv" 10 apt_get_install_this="perl make libmodule-build-perl libc6-dev gcc" ... 26 user_home=`get_user_home "$user"` 27 step "Installing dependencies" apt_get_install_deps 28 step "Downloading l3bashrc" ${wget} ${url_l3bashrc} 29 step "Downloading l3prompt" ${wget} ${url_l3prompt} 30 step "Downloading l3-agent" '${wget} ${url_l3agent}; ${wget} ${url_l3config_pm}; ${wget} ${url_l3config}' 31 step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }' 32 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; }' 33 step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users 34 step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users 35 step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users |
#cat install | grep '"$' | nl
1 lilalo_context="/users/${lilalo_user}/${lab}/${hostname}" 2 url_lilalo="http://xgu.ru/lilalo" 3 perl_modules="Term-VT102 Text-Iconv" 4 apt_get_install_this="perl make libmodule-build-perl libc6-dev gcc" 5 echo "Please install this dependencies manually:" 6 echo "Have you installed this already (y/n)?" 7 msg="$1" 8 printf "${whiteC}""$msg""...${normC}\n" 9 # eval "$@" 2>&1 | sed 's/^/|\ \ \ /' && printf "Ok\n" || printf "Failed\n" 10 printf "${redC}""Failed\n""${normC}" 11 users="$@" 12 users="$@" 13 users="$@" |
#cat install | grep '&'
uname -a | egrep -qi '(bsd|darwin)' && wget=fetch if which apt-get >& /dev/null # eval "$@" 2>&1 | sed 's/^/|\ \ \ /' && printf "Ok\n" || printf "Failed\n" eval "$@" 2>&1 > log 2>&1 && \ uname -a | egrep -qi '(freebsd|darwin)' && pw user show "$@"| awk -F: '{print $9}' || getent passwd "$@"| awk -F: '{print $6}' || echo "[ \$0 == l3script ] && . ${user_home}/.lilalo/l3bashrc && _l3_start" >> ${user_home}/.bashrc; chown -R ${user} ${user_home}/.bashrc |
#cat install | grep '&&'
uname -a | egrep -qi '(bsd|darwin)' && wget=fetch # eval "$@" 2>&1 | sed 's/^/|\ \ \ /' && printf "Ok\n" || printf "Failed\n" eval "$@" 2>&1 > log 2>&1 && \ uname -a | egrep -qi '(freebsd|darwin)' && pw user show "$@"| awk -F: '{print $9}' || getent passwd "$@"| awk -F: '{print $6}' || echo "[ \$0 == l3script ] && . ${user_home}/.lilalo/l3bashrc && _l3_start" >> ${user_home}/.bashrc; chown -R ${user} ${user_home}/.bashrc |
#cat install | grep '&+'
![]() |
#cat install | grep -E '&+'
uname -a | egrep -qi '(bsd|darwin)' && wget=fetch if which apt-get >& /dev/null # eval "$@" 2>&1 | sed 's/^/|\ \ \ /' && printf "Ok\n" || printf "Failed\n" eval "$@" 2>&1 > log 2>&1 && \ uname -a | egrep -qi '(freebsd|darwin)' && pw user show "$@"| awk -F: '{print $9}' || getent passwd "$@"| awk -F: '{print $6}' || echo "[ \$0 == l3script ] && . ${user_home}/.lilalo/l3bashrc && _l3_start" >> ${user_home}/.bashrc; chown -R ${user} ${user_home}/.bashrc |
#cat install | egrep '&+'
uname -a | egrep -qi '(bsd|darwin)' && wget=fetch if which apt-get >& /dev/null # eval "$@" 2>&1 | sed 's/^/|\ \ \ /' && printf "Ok\n" || printf "Failed\n" eval "$@" 2>&1 > log 2>&1 && \ uname -a | egrep -qi '(freebsd|darwin)' && pw user show "$@"| awk -F: '{print $9}' || getent passwd "$@"| awk -F: '{print $6}' || echo "[ \$0 == l3script ] && . ${user_home}/.lilalo/l3bashrc && _l3_start" >> ${user_home}/.bashrc; chown -R ${user} ${user_home}/.bashrc |
#cat install | egrep '&{2}'
uname -a | egrep -qi '(bsd|darwin)' && wget=fetch # eval "$@" 2>&1 | sed 's/^/|\ \ \ /' && printf "Ok\n" || printf "Failed\n" eval "$@" 2>&1 > log 2>&1 && \ uname -a | egrep -qi '(freebsd|darwin)' && pw user show "$@"| awk -F: '{print $9}' || getent passwd "$@"| awk -F: '{print $6}' || echo "[ \$0 == l3script ] && . ${user_home}/.lilalo/l3bashrc && _l3_start" >> ${user_home}/.bashrc; chown -R ${user} ${user_home}/.bashrc |
#cat install | egrep '&{1,2}'
uname -a | egrep -qi '(bsd|darwin)' && wget=fetch if which apt-get >& /dev/null # eval "$@" 2>&1 | sed 's/^/|\ \ \ /' && printf "Ok\n" || printf "Failed\n" eval "$@" 2>&1 > log 2>&1 && \ uname -a | egrep -qi '(freebsd|darwin)' && pw user show "$@"| awk -F: '{print $9}' || getent passwd "$@"| awk -F: '{print $6}' || echo "[ \$0 == l3script ] && . ${user_home}/.lilalo/l3bashrc && _l3_start" >> ${user_home}/.bashrc; chown -R ${user} ${user_home}/.bashrc |
#ls
f1 f2 f3 f4 f5 file.txt install proc.txt test.java wew34234rtert453 |
#cat -nl install
![]() cat: неверный ключ -- l Попробуйте «cat --help» для получения более подробного описания. |
#cat nl install
![]() cat: nl: Нет такого файла или каталога #!/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 ... 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 Втр Ноя 28 13:49:28 EET 2017 |
#cat install nl
![]() #!/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 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 Втр Ноя 28 13:49:28 EET 2017 cat: nl: Нет такого файла или каталога |
#vi ip.txt
![]() --- /dev/null 2017-11-24 15:19:42.412000125 +0200 +++ ip.txt 2017-11-28 16:06:09.095858018 +0200 @@ -0,0 +1,11 @@ +192.168.6.1 +10.0.1.0 +23.45.63.55 +255.233.4.3 +172.16.66.123 +192.168.137.1 +5.f.6.h +88.fd.77.777 +111.111.111.777 +15.g.g.y +77.gg.77.gg |
# 11
192.168.6.1 10.0.1.0 23.45.63.55 255.233.4.3 172.16.66.123 192.168.137.1 5.f.6.h 88.fd.77.777 111.111.111.777 15.g.g.y 77.gg.77.gg |
#cat ip.txt | egrep '^(([0-9]|[0-9]{2}]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[0-9]{2}|1[0-9]{2}|2[0-4][0-9]|25[0-5])$'
192.168.6.1 255.233.4.3 192.168.137.1 |
#sl
![]() l3script: sl: команда не найдена |
#ls
f1 f2 f3 f4 f5 file.txt install ip.txt passwd proc.txt test.java wew34234rtert453 |
#ca
cal calendar caller captoinfo case cat catchsegv catman |
ÐÑполÑзование: cat [ÐÐФÐÐÐ ²Ð²Ð¾Ð´ и оÑпÑавлÑÐµÑ Ð² ÑÑандаÑÑнÑй вÑвод. -A, --show-all Ñиноним -vET -b, --number-nonblank нÑмеÑоваÑÑ Ð½ÐµÐ¿ÑÑÑÑе ÑÑÑоки пÑи вÑводе -e подавлÑÐµÑ -n, Ñиноним -vE -E, --show-ends показÑваÑÑ $ в конÑе каждой ÑÑÑоки -n, --number нÑмеÑоваÑÑ Ð²Ñе ÑÑÑоки пÑи вÑводе -s, --squeeze-blank вÑводиÑÑ Ð½Ðµ более одной пÑÑÑой ÑÑÑоки пÑи повÑоÑе -t Ñиноним -vT -T, --show-tabs показÑваÑÑ Ñимволов ÑабÑлÑÑии как ^I -u (игноÑиÑÑеÑÑÑ) -v, --show-nonprinting иÑполÑзоваÑÑ Ð·Ð°Ð¿Ð¸ÑÑ Ñ ^ и M-, за иÑклÑÑением Ñимволов пеÑевода ÑÑÑоки и ÑабÑлÑÑии --help показаÑÑ ÑÑÑ ÑпÑÐ°Ð²ÐºÑ Ð¸ вÑйÑи --version показаÑÑ Ð¸Ð½ÑоÑмаÑÐ¸Ñ Ð¾ веÑÑии и вÑйÑи ÐÑли ФÐÐндаÑÑнÑй ввод. ÐÑимеÑÑ: cat f - g ÐÑÐ²Ð¾Ð´Ð¸Ñ ÑодеÑжимое f, поÑом ÑÑандаÑÑнÑй ввод, поÑом g. cat ÐопиÑÑÐµÑ ÑÑандаÑÑнÑй ввод на ÑÑандаÑÑнÑй вÑвод. Ðб оÑÐ¸Ð±ÐºÐ°Ñ Ð² cat ÑообÑайÑе по адÑеÑÑ bug-coreutils@gnu.org. ÐомаÑнÑÑ ÑÑÑаниÑа GNU coreutils: <http://www.gnu.org/software/coreutils/> СпÑавка по ÑабоÑе Ñ Ð¿ÑогÑаммами GNU: <http://www.gnu.org/gethelp/> Ðб оÑÐ¸Ð±ÐºÐ°Ñ Ð² пеÑеводе ÑообÑений «cat» ÑообÑайÑе по адÑеÑÑ <gnu@mx.ru> ÐÐ¾Ð»Ð½Ð°Ñ Ð´Ð¾ÐºÑменÑаÑÐ¸Ñ Ð´Ð¾ÑÑÑпна по команде: info coreutils 'cat invocation'
#!/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
/home/ivan /home/ivan/.bash_history
#!/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 Втр Ноя 28 13:49:28 EET 2017
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND user 3927 0.1 2.1 48096 10836 ? Ss Ноя27 2:29 l3-agent root 3401 0.2 2.0 47876 10556 ? Ss Ноя27 3:19 l3-agent root 7700 0.0 0.7 71380 3788 ? Ss 10:07 0:00 sshd: root@pts/0 root 7944 0.0 0.7 71380 3720 ? Ss 10:19 0:00 sshd: user [priv] root 8267 0.0 0.7 71288 3680 ? Ss 10:59 0:00 sshd: root@pts/4 root 8269 0.0 0.6 24308 3080 pts/4 Ss+ 10:59 0:00 -bash user 7947 0.0 0.5 24260 2932 pts/2 Ss 10:19 0:00 -bash user 8065 0.0 0.5 22260 3044 pts/3 Ss+ 10:20 0:00 l3script root 7702 0.0 0.5 22168 2860 pts/0 Ss 10:07 0:00 -bash root 7779 0.0 0.4 21656 2368 pts/1 Ss 10:07 0:00 l3script user 7946 0.0 0.3 71380 1976 ? S 10:19 0:00 sshd: user@pts/2 root 1885 0.0 0.3 118184 1560 ? Sl Ноя24 0:00 /usr/sbin/rsyslogd -c5 root 2233 0.0 0.2 49932 1252 ? Ss Ноя24 0:00 /usr/sbin/sshd 101 2260 0.0 0.2 46804 1036 ? Ss Ноя24 0:00 /usr/sbin/exim4 -bd -q30m root 271 0.0 0.2 21248 1184 ? Ss Ноя24 0:00 udevd --daemon root 9073 0.0 0.2 18948 1264 pts/1 R+ 14:04 0:00 ps uax root 9076 0.0 0.1 8164 632 pts/1 S+ 14:04 0:00 head -11 root 9075 0.0 0.1 8156 632 pts/1 S+ 14:04 0:00 tee proc.txt root 1915 0.0 0.1 4116 656 ? Ss Ноя24 0:00 /usr/sbin/acpid root 1957 0.0 0.1 22492 896 ? Ss Ноя24 0:00 /usr/sbin/cron root 2292 0.0 0.1 18368 972 tty6 Ss+ Ноя24 0:00 /sbin/getty 38400 tty6 root 2290 0.0 0.1 18368 972 tty4 Ss+ Ноя24 0:00 /sbin/getty 38400 tty4 root 2289 0.0 0.1 18368 972 tty3 Ss+ Ноя24 0:00 /sbin/getty 38400 tty3 root 2288 0.0 0.1 18368 972 tty2 Ss+ Ноя24 0:00 /sbin/getty 38400 tty2 root 2291 0.0 0.1 18368 968 tty5 Ss+ Ноя24 0:00 /sbin/getty 38400 tty5 root 2287 0.0 0.1 18368 968 tty1 Ss+ Ноя24 0:00 /sbin/getty 38400 tty1 user 7993 0.0 0.1 18164 840 pts/2 S+ 10:20 0:00 script -f -c l3script -q /home/user/.lilalo//18672123072488726568-1511857210.script root 7747 0.0 0.1 18164 840 pts/0 S+ 10:07 0:00 script -f -c l3script -q /root/.lilalo//3394282872625917685-1511856471.script root 9074 0.0 0.1 16220 800 pts/1 S+ 14:04 0:00 sort -k4 -r root 1 0.0 0.1 10648 828 ? Ss Ноя24 0:06 init [2] user 8064 0.0 0.0 18168 468 pts/2 S+ 10:20 0:00 script -f -c l3script -q /home/user/.lilalo//18672123072488726568-1511857210.script root 7778 0.0 0.0 18168 468 pts/0 S+ 10:07 0:00 script -f -c l3script -q /root/.lilalo//3394282872625917685-1511856471.script root 3874 0.0 0.0 0 0 ? S Ноя27 0:01 [kworker/0:1] root 3358 0.0 0.0 0 0 ? S Ноя27 0:00 [flush-202:0] root 108 0.0 0.0 0 0 ? S Ноя24 0:06 [kworker/0:2] root 7 0.0 0.0 0 0 ? S Ноя24 0:03 [watchdog/0] root 14 0.0 0.0 0 0 ? S Ноя24 0:01 [sync_supers] root 3 0.0 0.0 0 0 ? S Ноя24 0:01 [ksoftirqd/0] root 127 0.0 0.0 0 0 ? S Ноя24 0:01 [jbd2/xvda1-8] root 12 0.0 0.0 0 0 ? S Ноя24 0:00 [xenwatch] root 13 0.0 0.0 0 0 ? S Ноя24 0:00 [xenbus] root 89 0.0 0.0 0 0 ? S Ноя24 0:00 [scsi_eh_1] root 88 0.0 0.0 0 0 ? S Ноя24 0:00 [scsi_eh_0] root 11 0.0 0.0 0 0 ? S< Ноя24 0:00 [netns] root 6 0.0 0.0 0 0 ? S Ноя24 0:00 [migration/0] root 90 0.0 0.0 0 0 ? S Ноя24 0:00 [kworker/u:1] root 5 0.0 0.0 0 0 ? S Ноя24 0:00 [kworker/u:0] root 2 0.0 0.0 0 0 ? S Ноя24 0:00 [kthreadd] root 20 0.0 0.0 0 0 ? S Ноя24 0:00 [kswapd0] root 378 0.0 0.0 0 0 ? S< Ноя24 0:00 [kpsmoused] root 16 0.0 0.0 0 0 ? S< Ноя24 0:00 [kintegrityd] root 19 0.0 0.0 0 0 ? S Ноя24 0:00 [khungtaskd] root 9 0.0 0.0 0 0 ? S< Ноя24 0:00 [khelper] root 10 0.0 0.0 0 0 ? S Ноя24 0:00 [kdevtmpfs] root 17 0.0 0.0 0 0 ? S< Ноя24 0:00 [kblockd] root 22 0.0 0.0 0 0 ? S Ноя24 0:00 [fsnotify_mark] root 128 0.0 0.0 0 0 ? S< Ноя24 0:00 [ext4-dio-unwrit] root 23 0.0 0.0 0 0 ? S< Ноя24 0:00 [crypto] root 8 0.0 0.0 0 0 ? S< Ноя24 0:00 [cpuset] root 15 0.0 0.0 0 0 ? S Ноя24 0:00 [bdi-default] root 87 0.0 0.0 0 0 ? S< Ноя24 0:00 [ata_sff] root 21 0.0 0.0 0 0 ? SN Ноя24 0:00 [ksmd]
Время первой команды журнала | 10:26:17 2017-11-28 |
Время последней команды журнала | 15:32:12 2017-11-28 |
Количество командных строк в журнале | 101 |
Процент команд с ненулевым кодом завершения, % | 15.84 |
Процент синтаксически неверно набранных команд, % | 6.93 |
Суммарное время работы с терминалом *, час | 2.55 |
Количество командн |