Журнал лабораторных работ

Содержание

Журнал

Вторник (02/04/20)

/dev/pts/1
10:22:48
#cd ..

10:23:04
#ls
bin   dev  home        lib    lib64       media  opt   root  sbin     srv  tmp  var
boot  etc  initrd.img  lib32  lost+found  mnt    proc  run   selinux  sys  usr  vmlinuz
10:23:07
#cd bin

10:23:22
#ls
-qwwuiq  cpio           echo       gzip      lesspipe  more            netstat        readlink    sleep     umount         zegrep
\qwwuiq  dash           egrep      hostname  ln        mount           nisdomainname  rm          ss        uname          zfgrep
bash     date           false      ip        loadkeys  mountpoint      open           rmdir       stty      uncompress     zforce
busybox  dd             fgconsole  kbd_mode  login     mt              openvt         rnano       su        unicode_start  zgrep
cat      df             fgrep      kill      ls        mt-gnu          pidof          run-parts   sync      vdir           zless
chgrp    dir            findmnt    kmod      lsblk     mv              ping           sed         tailf     which          zmore
chmod    dmesg          fuser      less      lsmod     nano            ping6          setfont     tar       ypdomainname   znew
chown    dnsdomainname  grep       lessecho  mkdir     nc              ps             setupcon    tempfile  zcat
chvt     domainname     gunzip     lessfile  mknod     nc.traditional  pwd            sh          touch     zcmp
cp       dumpkeys       gzexe      lesskey   mktemp    netcat          rbash          sh.distrib  true      zdiff
10:23:34
#clear

10:23:39
#ls
-qwwuiq  cpio           echo       gzip      lesspipe  more            netstat        readlink    sleep     umount         zegrep
\qwwuiq  dash           egrep      hostname  ln        mount           nisdomainname  rm          ss        uname          zfgrep
bash     date           false      ip        loadkeys  mountpoint      open           rmdir       stty      uncompress     zforce
busybox  dd             fgconsole  kbd_mode  login     mt              openvt         rnano       su        unicode_start  zgrep
cat      df             fgrep      kill      ls        mt-gnu          pidof          run-parts   sync      vdir           zless
chgrp    dir            findmnt    kmod      lsblk     mv              ping           sed         tailf     which          zmore
chmod    dmesg          fuser      less      lsmod     nano            ping6          setfont     tar       ypdomainname   znew
chown    dnsdomainname  grep       lessecho  mkdir     nc              ps             setupcon    tempfile  zcat
chvt     domainname     gunzip     lessfile  mknod     nc.traditional  pwd            sh          touch     zcmp
cp       dumpkeys       gzexe      lesskey   mktemp    netcat          rbash          sh.distrib  true      zdiff
10:23:41
#ls /*
/initrd.img  /vmlinuz
/bin:
-qwwuiq  cpio           echo       gzip      lesspipe  more            netstat        readlink    sleep     umount         zegrep
\qwwuiq  dash           egrep      hostname  ln        mount           nisdomainname  rm          ss        uname          zfgrep
bash     date           false      ip        loadkeys  mountpoint      open           rmdir       stty      uncompress     zforce
busybox  dd             fgconsole  kbd_mode  login     mt              openvt         rnano       su        unicode_start  zgrep
cat      df             fgrep      kill      ls        mt-gnu          pidof          run-parts   sync      vdir           zless
chgrp    dir            findmnt    kmod      lsblk     mv              ping           sed         tailf     which          zmore
chmod    dmesg          fuser      less      lsmod     nano            ping6          setfont     tar       ypdomainname   znew
chown    dnsdomainname  grep       lessecho  mkdir     nc              ps             setupcon    tempfile  zcat
...
/selinux:
/srv:
/sys:
block  bus  class  dev  devices  firmware  fs  hypervisor  kernel  module  power
/tmp:
My  f1  f1h
/usr:
bin  games  include  lib  lib32  local  sbin  share  src
/var:
backups  cache  lib  local  lock  log  mail  opt  run  spool  tmp
10:24:05
#clear

10:24:23
#ls
-qwwuiq  cpio           echo       gzip      lesspipe  more            netstat        readlink    sleep     umount         zegrep
\qwwuiq  dash           egrep      hostname  ln        mount           nisdomainname  rm          ss        uname          zfgrep
bash     date           false      ip        loadkeys  mountpoint      open           rmdir       stty      uncompress     zforce
busybox  dd             fgconsole  kbd_mode  login     mt              openvt         rnano       su        unicode_start  zgrep
cat      df             fgrep      kill      ls        mt-gnu          pidof          run-parts   sync      vdir           zless
chgrp    dir            findmnt    kmod      lsblk     mv              ping           sed         tailf     which          zmore
chmod    dmesg          fuser      less      lsmod     nano            ping6          setfont     tar       ypdomainname   znew
chown    dnsdomainname  grep       lessecho  mkdir     nc              ps             setupcon    tempfile  zcat
chvt     domainname     gunzip     lessfile  mknod     nc.traditional  pwd            sh          touch     zcmp
cp       dumpkeys       gzexe      lesskey   mktemp    netcat          rbash          sh.distrib  true      zdiff
10:24:25
#ls '/*'
ls: cannot access /*: No such file or directory
10:24:42
#ls \*
ls: cannot access *: No such file or directory
10:24:55
#ls '\*'
ls: cannot access \*: No such file or directory
10:25:01
#ls [\]*
ls: cannot access []*: No such file or directory
10:26:14
#ls
-qwwuiq  cpio           echo       gzip      lesspipe  more            netstat        readlink    sleep     umount         zegrep
\qwwuiq  dash           egrep      hostname  ln        mount           nisdomainname  rm          ss        uname          zfgrep
bash     date           false      ip        loadkeys  mountpoint      open           rmdir       stty      uncompress     zforce
busybox  dd             fgconsole  kbd_mode  login     mt              openvt         rnano       su        unicode_start  zgrep
cat      df             fgrep      kill      ls        mt-gnu          pidof          run-parts   sync      vdir           zless
chgrp    dir            findmnt    kmod      lsblk     mv              ping           sed         tailf     which          zmore
chmod    dmesg          fuser      less      lsmod     nano            ping6          setfont     tar       ypdomainname   znew
chown    dnsdomainname  grep       lessecho  mkdir     nc              ps             setupcon    tempfile  zcat
chvt     domainname     gunzip     lessfile  mknod     nc.traditional  pwd            sh          touch     zcmp
cp       dumpkeys       gzexe      lesskey   mktemp    netcat          rbash          sh.distrib  true      zdiff
10:26:18
#ls .\\*
ls: cannot access .\*: No such file or directory
10:27:00
#ls ./\*
ls: cannot access ./*: No such file or directory
10:27:12
#ls '\qwwuiq'
\qwwuiq
10:28:00
#ls '\'*
\qwwuiq
10:28:14
#ls '-'*
ls: invalid line width: wuiq
10:28:21
#ls ./-*
./-qwwuiq
10:28:32
#ls -a
-qwwuiq   chown  dnsdomainname  grep      lessecho  mkdir       nc              ps         setupcon    tempfile       zcat
.         chvt   domainname     gunzip    lessfile  mknod       nc.traditional  pwd        sh          touch          zcmp
..        cp     dumpkeys       gzexe     lesskey   mktemp      netcat          rbash      sh.distrib  true           zdiff
..qwwuiq  cpio   echo           gzip      lesspipe  more        netstat         readlink   sleep       umount         zegrep
\qwwuiq   dash   egrep          hostname  ln        mount       nisdomainname   rm         ss          uname          zfgrep
bash      date   false          ip        loadkeys  mountpoint  open            rmdir      stty        uncompress     zforce
busybox   dd     fgconsole      kbd_mode  login     mt          openvt          rnano      su          unicode_start  zgrep
cat       df     fgrep          kill      ls        mt-gnu      pidof           run-parts  sync        vdir           zless
chgrp     dir    findmnt        kmod      lsblk     mv          ping            sed        tailf       which          zmore
chmod     dmesg  fuser          less      lsmod     nano        ping6           setfont    tar         ypdomainname   znew
10:29:13
#ls ..*
..qwwuiq
..:
bin   dev  home        lib    lib64       media  opt   root  sbin     srv  tmp  var
boot  etc  initrd.img  lib32  lost+found  mnt    proc  run   selinux  sys  usr  vmlinuz
10:29:46
#ls "..'*
> ^C
10:30:01
#ls '..'*
..qwwuiq
..:
bin   dev  home        lib    lib64       media  opt   root  sbin     srv  tmp  var
boot  etc  initrd.img  lib32  lost+found  mnt    proc  run   selinux  sys  usr  vmlinuz
10:30:05
#ls '..'q*
..qwwuiq
10:30:49
#ls '..'q*
..qwwuiq
10:32:50
#rm '..'q*

10:32:56
#ls '..'q*
ls: cannot access ..q*: No such file or directory
10:32:58
#ls -a
-qwwuiq  chvt           domainname  gunzip    lessfile  mknod       nc.traditional  pwd        sh          touch          zcmp
.        cp             dumpkeys    gzexe     lesskey   mktemp      netcat          rbash      sh.distrib  true           zdiff
..       cpio           echo        gzip      lesspipe  more        netstat         readlink   sleep       umount         zegrep
\qwwuiq  dash           egrep       hostname  ln        mount       nisdomainname   rm         ss          uname          zfgrep
bash     date           false       ip        loadkeys  mountpoint  open            rmdir      stty        uncompress     zforce
busybox  dd             fgconsole   kbd_mode  login     mt          openvt          rnano      su          unicode_start  zgrep
cat      df             fgrep       kill      ls        mt-gnu      pidof           run-parts  sync        vdir           zless
chgrp    dir            findmnt     kmod      lsblk     mv          ping            sed        tailf       which          zmore
chmod    dmesg          fuser       less      lsmod     nano        ping6           setfont    tar         ypdomainname   znew
chown    dnsdomainname  grep        lessecho  mkdir     nc          ps              setupcon   tempfile    zcat
10:33:10
#ls ./-*
./-qwwuiq
10:33:18
#rm ./-*

10:33:25
#ls ./-*
ls: cannot access ./-*: No such file or directory
10:33:27
#ls -a
.        chvt   dnsdomainname  fuser     kmod      ls          mt              open      rm          sleep     true           zcmp
..       cp     domainname     grep      less      lsblk       mt-gnu          openvt    rmdir       ss        umount         zdiff
\qwwuiq  cpio   dumpkeys       gunzip    lessecho  lsmod       mv              pidof     rnano       stty      uname          zegrep
bash     dash   echo           gzexe     lessfile  mkdir       nano            ping      run-parts   su        uncompress     zfgrep
busybox  date   egrep          gzip      lesskey   mknod       nc              ping6     sed         sync      unicode_start  zforce
cat      dd     false          hostname  lesspipe  mktemp      nc.traditional  ps        setfont     tailf     vdir           zgrep
chgrp    df     fgconsole      ip        ln        more        netcat          pwd       setupcon    tar       which          zless
chmod    dir    fgrep          kbd_mode  loadkeys  mount       netstat         rbash     sh          tempfile  ypdomainname   zmore
chown    dmesg  findmnt        kill      login     mountpoint  nisdomainname   readlink  sh.distrib  touch     zcat           znew
10:33:41
#ls '\'*
\qwwuiq
10:33:52
#rm '\'*

10:33:58
#ls -a
.        cpio           echo       gzip      lesspipe  more            netstat        readlink    sleep     umount         zegrep
..       dash           egrep      hostname  ln        mount           nisdomainname  rm          ss        uname          zfgrep
bash     date           false      ip        loadkeys  mountpoint      open           rmdir       stty      uncompress     zforce
busybox  dd             fgconsole  kbd_mode  login     mt              openvt         rnano       su        unicode_start  zgrep
cat      df             fgrep      kill      ls        mt-gnu          pidof          run-parts   sync      vdir           zless
chgrp    dir            findmnt    kmod      lsblk     mv              ping           sed         tailf     which          zmore
chmod    dmesg          fuser      less      lsmod     nano            ping6          setfont     tar       ypdomainname   znew
chown    dnsdomainname  grep       lessecho  mkdir     nc              ps             setupcon    tempfile  zcat
chvt     domainname     gunzip     lessfile  mknod     nc.traditional  pwd            sh          touch     zcmp
cp       dumpkeys       gzexe      lesskey   mktemp    netcat          rbash          sh.distrib  true      zdiff
10:34:00
#cd

10:34:06
#clear

10:34:09
#clerar
l3script: clerar: command not found
10:34:12
#clear

10:34:15
#touch "Andrey Stah"

10:34:37
#ls
Andrey Stah  d1  d2  install  ~ivan  ~petr  ~user
10:34:41
#ls -a
.   .aptitude      .bash_profile  .l3rc    .profile  .viminfo  Andrey Stah  d2       ~ivan  ~user
..  .bash_history  .bashrc        .lilalo  .vim      .vimrc    d1           install  ~petr
10:34:50
#ls -s
total 28
0 Andrey Stah  4 d1  4 d2  8 install  4 ~ivan  4 ~petr  4 ~user
10:34:56
#ls -l
total 28
-rw-r--r-- 1 root root    0 Feb  4 11:34 Andrey Stah
drwxr-xr-x 2 root root 4096 Feb  3 12:52 d1
drwxr-xr-x 3 root root 4096 Feb  3 15:17 d2
-rw-r--r-- 1 root root 5268 Oct 13  2014 install
-rw-r--r-- 1 root root   96 Feb  4 10:05 ~ivan
-rw-r--r-- 1 root root   96 Feb  4 10:05 ~petr
-rw-r--r-- 1 root root   96 Feb  4 10:05 ~user
10:35:01
#clear

10:35:08
#touch 'Andrey Stah2'

10:35:19
#ls -l
total 28
-rw-r--r-- 1 root root    0 Feb  4 11:34 Andrey Stah
-rw-r--r-- 1 root root    0 Feb  4 11:35 Andrey Stah2
drwxr-xr-x 2 root root 4096 Feb  3 12:52 d1
drwxr-xr-x 3 root root 4096 Feb  3 15:17 d2
-rw-r--r-- 1 root root 5268 Oct 13  2014 install
-rw-r--r-- 1 root root   96 Feb  4 10:05 ~ivan
-rw-r--r-- 1 root root   96 Feb  4 10:05 ~petr
-rw-r--r-- 1 root root   96 Feb  4 10:05 ~user
10:35:21
#touch one\ space

10:35:50
#ls -l
total 28
-rw-r--r-- 1 root root    0 Feb  4 11:34 Andrey Stah
-rw-r--r-- 1 root root    0 Feb  4 11:35 Andrey Stah2
drwxr-xr-x 2 root root 4096 Feb  3 12:52 d1
drwxr-xr-x 3 root root 4096 Feb  3 15:17 d2
-rw-r--r-- 1 root root 5268 Oct 13  2014 install
-rw-r--r-- 1 root root    0 Feb  4 11:35 one space
-rw-r--r-- 1 root root   96 Feb  4 10:05 ~ivan
-rw-r--r-- 1 root root   96 Feb  4 10:05 ~petr
-rw-r--r-- 1 root root   96 Feb  4 10:05 ~user
10:36:20
#touch "A' Stah"

10:37:31
#ls -l
total 28
-rw-r--r-- 1 root root    0 Feb  4 11:37 A' Stah
-rw-r--r-- 1 root root    0 Feb  4 11:34 Andrey Stah
-rw-r--r-- 1 root root    0 Feb  4 11:35 Andrey Stah2
drwxr-xr-x 2 root root 4096 Feb  3 12:52 d1
drwxr-xr-x 3 root root 4096 Feb  3 15:17 d2
-rw-r--r-- 1 root root 5268 Oct 13  2014 install
-rw-r--r-- 1 root root    0 Feb  4 11:35 one space
-rw-r--r-- 1 root root   96 Feb  4 10:05 ~ivan
-rw-r--r-- 1 root root   96 Feb  4 10:05 ~petr
-rw-r--r-- 1 root root   96 Feb  4 10:05 ~user
10:37:33
#touch "A:\Stah\11"

10:38:06
#ls -l
total 28
-rw-r--r-- 1 root root    0 Feb  4 11:37 A' Stah
-rw-r--r-- 1 root root    0 Feb  4 11:38 A:\Stah\11
-rw-r--r-- 1 root root    0 Feb  4 11:34 Andrey Stah
-rw-r--r-- 1 root root    0 Feb  4 11:35 Andrey Stah2
drwxr-xr-x 2 root root 4096 Feb  3 12:52 d1
drwxr-xr-x 3 root root 4096 Feb  3 15:17 d2
-rw-r--r-- 1 root root 5268 Oct 13  2014 install
-rw-r--r-- 1 root root    0 Feb  4 11:35 one space
-rw-r--r-- 1 root root   96 Feb  4 10:05 ~ivan
-rw-r--r-- 1 root root   96 Feb  4 10:05 ~petr
-rw-r--r-- 1 root root   96 Feb  4 10:05 ~user
10:38:07
#touch A:\\Stah\\22

10:38:42
#ls -l
total 28
-rw-r--r-- 1 root root    0 Feb  4 11:37 A' Stah
-rw-r--r-- 1 root root    0 Feb  4 11:38 A:\Stah\11
-rw-r--r-- 1 root root    0 Feb  4 11:38 A:\Stah\22
-rw-r--r-- 1 root root    0 Feb  4 11:34 Andrey Stah
-rw-r--r-- 1 root root    0 Feb  4 11:35 Andrey Stah2
drwxr-xr-x 2 root root 4096 Feb  3 12:52 d1
drwxr-xr-x 3 root root 4096 Feb  3 15:17 d2
-rw-r--r-- 1 root root 5268 Oct 13  2014 install
-rw-r--r-- 1 root root    0 Feb  4 11:35 one space
-rw-r--r-- 1 root root   96 Feb  4 10:05 ~ivan
-rw-r--r-- 1 root root   96 Feb  4 10:05 ~petr
-rw-r--r-- 1 root root   96 Feb  4 10:05 ~user
10:38:43
#echo *
A' Stah A:\Stah\11 A:\Stah\22 Andrey Stah Andrey Stah2 d1 d2 install one space ~ivan ~petr ~user
10:39:35
#touch '-bad-name-'
touch: invalid option -- 'b'
Try `touch --help' for more information.
10:40:45
#touch ./-bad-name-

10:41:02
#ls -l
total 28
-rw-r--r-- 1 root root    0 Feb  4 11:41 -bad-name-
-rw-r--r-- 1 root root    0 Feb  4 11:37 A' Stah
-rw-r--r-- 1 root root    0 Feb  4 11:38 A:\Stah\11
-rw-r--r-- 1 root root    0 Feb  4 11:38 A:\Stah\22
-rw-r--r-- 1 root root    0 Feb  4 11:34 Andrey Stah
-rw-r--r-- 1 root root    0 Feb  4 11:35 Andrey Stah2
drwxr-xr-x 2 root root 4096 Feb  3 12:52 d1
drwxr-xr-x 3 root root 4096 Feb  3 15:17 d2
-rw-r--r-- 1 root root 5268 Oct 13  2014 install
-rw-r--r-- 1 root root    0 Feb  4 11:35 one space
-rw-r--r-- 1 root root   96 Feb  4 10:05 ~ivan
-rw-r--r-- 1 root root   96 Feb  4 10:05 ~petr
-rw-r--r-- 1 root root   96 Feb  4 10:05 ~user
10:41:05
#ls
-bad-name-  A' Stah  A:\Stah\11  A:\Stah\22  Andrey Stah  Andrey Stah2  d1  d2  install  one space  ~ivan  ~petr  ~user
прошло 67 минут
11:48:29
#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
11:48:39
#cat install | grep agent
install_l3bashrc_for_this_users=${users:-"root user"}  # users who will use l3agent and l3script
url_l3agent="${url_lilalo}"/l3-agent
        cp l3-agent /usr/local/bin
        chmod 755 /usr/local/bin/l3-{agent,config}
        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; }
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 "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users
11:50:00
#cat install | grep agent
install_l3bashrc_for_this_users=${users:-"root user"}  # users who will use l3agent and l3script
url_l3agent="${url_lilalo}"/l3-agent
        cp l3-agent /usr/local/bin
        chmod 755 /usr/local/bin/l3-{agent,config}
        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; }
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 "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users
11:50:08
#cat install | grep agent | nl
     1  install_l3bashrc_for_this_users=${users:-"root user"}  # users who will use l3agent and l3script
     2  url_l3agent="${url_lilalo}"/l3-agent
     3          cp l3-agent /usr/local/bin
     4          chmod 755 /usr/local/bin/l3-{agent,config}
     5          grep -q l3-agent ${user_home}/.bash_profile 2> /dev/null \
     6          || { 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; }
     7  step "Downloading l3-agent" '${wget} ${url_l3agent}; ${wget} ${url_l3config_pm}; ${wget} ${url_l3config}'
     8  step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }'
     9  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; }'
    10  step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users
11:50:47
#cat install | grep agent | nl
     1  install_l3bashrc_for_this_users=${users:-"root user"}  # users who will use l3agent and l3script
     2  url_l3agent="${url_lilalo}"/l3-agent
     3          cp l3-agent /usr/local/bin
     4          chmod 755 /usr/local/bin/l3-{agent,config}
     5          grep -q l3-agent ${user_home}/.bash_profile 2> /dev/null \
     6          || { 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; }
     7  step "Downloading l3-agent" '${wget} ${url_l3agent}; ${wget} ${url_l3config_pm}; ${wget} ${url_l3config}'
     8  step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }'
     9  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; }'
    10  step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users
11:50:59
#cat install | grep ^step
step()
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
11:51:47
#cat install | grep ^step | nl
     1  step()
     2  step "Installing dependencies" apt_get_install_deps
     3  step "Downloading l3bashrc" ${wget} ${url_l3bashrc}
     4  step "Downloading l3prompt" ${wget} ${url_l3prompt}
     5  step "Downloading l3-agent" '${wget} ${url_l3agent}; ${wget} ${url_l3config_pm}; ${wget} ${url_l3config}'
     6  step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }'
     7  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; }'
     8  step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users
     9  step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users
    10  step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users
11:52:02
#cat install | grep 'step$' | nl

11:52:27
#cat install | grep 'users$' | nl
     1      for user in $users
     2      for user in $users
     3      for user in $users
     4  step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users
     5  step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users
     6  step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users
11:52:44
#cat install | grep 'users$' | nl
     1      for user in $users
     2      for user in $users
     3      for user in $users
     4  step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users
     5  step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users
     6  step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users
11:52:46
#vi install
--- /tmp/l3-saved-7810.1846.27685	2020-02-04 12:53:07.016254647 +0200
+++ install	2020-02-04 12:54:08.020233745 +0200
@@ -87,7 +87,7 @@
     . l3bashrc
     users="$@"
     set -x
-    for user in $users
+    for user in $user
     do
         user_home=`get_user_home "$user"`
         mkdir -p ${user_home}/${lilalo_home}
11:54:08
#cat install | grep 'user$' | nl
     1      for user in $user
11:54:17
#cat install | grep 'users?$' | nl

11:55:33
#cat install | egrep 'users?$' | nl
     1      for user in $user
     2      for user in $users
     3      for user in $users
     4  step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users
     5  step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users
     6  step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users
11:56:01
#vi install
--- /tmp/l3-saved-7810.2601.18666	2020-02-04 13:30:56.664259989 +0200
+++ install	2020-02-04 13:33:00.268322566 +0200
@@ -174,6 +174,7 @@
 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 "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.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
прошло 36 минут
12:33:00
#cat install | egrep '(tar)?$' | nl
     1  #!/bin/sh
     2  hostname=`hostname`
     3  uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f`
     4  ###############################################################################
     5  #
     6  # Set this variables before installation:
     7  lilalo_user=13-10-2014
     8  lab=NT-LNet
     9  install_l3bashrc_for_this_users=${users:-"root user"}  # users who will use l3agent and l3script
    10  lilalo_context="/users/${lilalo_user}/${lab}/${hostname}"
...
   146  step "Downloading l3-agent" '${wget} ${url_l3agent}; ${wget} ${url_l3config_pm}; ${wget} ${url_l3config}'
   147  step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }'
   148  step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.gz; done; }'
   149  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; }'
   150  step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users
   151  step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users
   152  step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users
   153  cd /
   154  rm -rf ${temp_dir}
   155  show_final_message
12:33:54
#cat install | egrep '$i.(tar)?.gz' | nl

12:35:05
#cat install | egrep '$i.(tar)?.gz'

12:35:10
#cat install | egrep '$i(.tar)?.gz'

12:35:30
#cat install | egrep '\$i(\.tar)?\.gz'
step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }'
step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.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; }'
12:36:44
#cat install | egrep '\$i(\.tar)?\.gz' | nl
     1  step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }'
     2  step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.gz; done; }'
     3  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; }'
12:36:56
#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 "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.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
прошло 33 минуты
13:10:33
#cat install | tr [:punct:] ' '
   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
...
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  Downloading perl modules for l3 agent     for i in   perl modules   do   wget    url perl modules   i 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
13:14:03
#cat install | tr [:punct:] ' ' | tr -s ' '
 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
...
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 Downloading perl modules for l3 agent for i in perl modules do wget url perl modules i 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
13:14:47
#cat install | tr [:punct:] ' ' | tr -s ' ' | tr ' ' '\n'
bin
sh
hostname
hostname
uname
a
egrep
qi
freebsd
darwin
...
this
users
cd
rm
rf
temp
dir
show
final
message
13:15:34
#cat install | tr [:punct:] ' ' | tr -s ' ' | tr ' ' '\n' | tr -s '\n'
bin
sh
hostname
hostname
uname
a
egrep
qi
freebsd
darwin
...
this
users
cd
rm
rf
temp
dir
show
final
message
13:16:20
#cat install | tr [:punct:] ' ' | tr -s ' ' | tr ' ' '\n' | tr -s '\n' | sort
0
0
0
0
0
0
033
033
033
033
...
y
y
yY
you
you
you
your
your
your
z
13:17:15
#cat install | tr [:punct:] ' ' | tr -s ' ' | tr ' ' '\n' | tr -s '\n' | sort | tr [:upper:] [:lower:]
0
0
0
0
0
0
033
033
033
033
...
y
y
yy
you
you
you
your
your
your
z
13:18:41
#cat install | tr [:punct:] ' ' | tr -s ' ' | tr ' ' '\n' | tr -s '\n' | sort | tr [:upper:] [:lower:] | egrep '.{3

13:18:41
#cat install | tr [:punct:] ' ' | tr -s ' ' | tr ' ' '\n' | tr -s '\n' | sort | tr [:upper:] [:lower:] | egrep '.{3,}
033
033
033
033
2014
31m
32m
37m
39m
755
...
xgu
xgu
xgu
xvfz
you
you
you
your
your
your
13:20:29
#cat install | tr [:punct:] ' ' | tr -s ' ' | tr ' ' '\n' | tr -s '\n' | sort | tr [:upper:] [:lower:]

13:20:29
#cat install | tr [:punct:] ' ' | tr -s ' ' | tr ' ' '\n' | tr -s '\n' | sort| tr [:upper:] [:lower:] | egrep '.{3,}

13:20:29
#cat install | tr [:punct:] ' ' | tr -s ' ' | tr ' ' '\n' | tr -s '\n' | tr [:upper:] [:lower:] | egrep '.{3,}' | sor
033
033
033
033
2014
31m
32m
37m
39m
755
...
xgu
xgu
xvfz
you
you
you
your
your
your
your
13:23:27
#cd /etc/cron.daily/

прошло 65 минут
14:29:03
#./locate

14:29:12
#vi locate
14:33:45
#{IONICE_PRIORITY:-7}" ;;

14:33:47
#find . -emty
find: unknown predicate `-emty'
14:39:54
#find . -emty -type f
find: unknown predicate `-emty'
14:40:10
#find / -regex ".*\.jpe&g"

Файлы

  • install
  • 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}"
    #
    ###############################################################################
    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 $user
        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 "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.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:22:48 2020- 2- 4
    Время последней команды журнала14:40:10 2020- 2- 4
    Количество командных строк в журнале101
    Процент команд с ненулевым кодом завершения, %13.86
    Процент синтаксически неверно набранных команд, % 0.99
    Суммарное время работы с терминалом *, час 0.90
    Количество командных строк в единицу времени, команда/мин 1.88
    Частота использования команд
    ls40|=========================| 25.97%
    cat31|====================| 20.13%
    nl12|=======| 7.79%
    egrep11|=======| 7.14%
    grep11|=======| 7.14%
    tr11|=======| 7.14%
    touch8|=====| 5.19%
    sort6|===| 3.90%
    clear5|===| 3.25%
    cd4|==| 2.60%
    rm3|=| 1.95%
    vi3|=| 1.95%
    find3|=| 1.95%
    g"1|| 0.65%
    {IONICE_PRIORITY:-7}"1|| 0.65%
    clerar1|| 0.65%
    locate1|| 0.65%
    echo1|| 0.65%
    sor1|| 0.65%
    ____
    *) Интервалы неактивности длительностью 30 минут и более не учитываются

    Справка

    Для того чтобы использовать LiLaLo, не нужно знать ничего особенного: всё происходит само собой. Однако, чтобы ведение и последующее использование журналов было как можно более эффективным, желательно иметь в виду следующее:
    1. В журнал автоматически попадают все команды, данные в любом терминале системы.

    2. Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду w. В поле WHAT, соответствующем текущему терминалу, должна быть указана программа script.

    3. Команды, при наборе которых были допущены синтаксические ошибки, выводятся перечёркнутым текстом:
      $ l s-l
      bash: l: command not found
      

    4. Если код завершения команды равен нулю, команда была выполнена без ошибок. Команды, код завершения которых отличен от нуля, выделяются цветом.
      $ test 5 -lt 4
      Обратите внимание на то, что код завершения команды может быть отличен от нуля не только в тех случаях, когда команда была выполнена с ошибкой. Многие команды используют код завершения, например, для того чтобы показать результаты проверки

    5. Команды, ход выполнения которых был прерван пользователем, выделяются цветом.
      $ 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
      

    6. Команды, выполненные с привилегиями суперпользователя, выделяются слева красной чертой.
      # id
      uid=0(root) gid=0(root) Gruppen=0(root)
      

    7. Изменения, внесённые в текстовый файл с помощью редактора, запоминаются и показываются в журнале в формате ed. Строки, начинающиеся символом "<", удалены, а строки, начинающиеся символом ">" -- добавлены.
      $ vi ~/.bashrc
      2a3,5
      >    if [ -f /usr/local/etc/bash_completion ]; then
      >         . /usr/local/etc/bash_completion
      >        fi
      

    8. Для того чтобы изменить файл в соответствии с показанными в диффшоте изменениями, можно воспользоваться командой patch. Нужно скопировать изменения, запустить программу patch, указав в качестве её аргумента файл, к которому применяются изменения, и всавить скопированный текст:
      $ patch ~/.bashrc
      В данном случае изменения применяются к файлу ~/.bashrc

    9. Для того чтобы получить краткую справочную информацию о команде, нужно подвести к ней мышь. Во всплывающей подсказке появится краткое описание команды.

      Если справочная информация о команде есть, команда выделяется голубым фоном, например: vi. Если справочная информация отсутствует, команда выделяется розовым фоном, например: notepad.exe. Справочная информация может отсутствовать в том случае, если (1) команда введена неверно; (2) если распознавание команды LiLaLo выполнено неверно; (3) если информация о команде неизвестна LiLaLo. Последнее возможно для редких команд.

    10. Большие, в особенности многострочные, всплывающие подсказки лучше всего показываются браузерами KDE Konqueror, Apple Safari и Microsoft Internet Explorer. В браузерах Mozilla и Firefox они отображаются не полностью, а вместо перевода строки выводится специальный символ.

    11. Время ввода команды, показанное в журнале, соответствует времени начала ввода командной строки, которое равно тому моменту, когда на терминале появилось приглашение интерпретатора

    12. Имя терминала, на котором была введена команда, показано в специальном блоке. Этот блок показывается только в том случае, если терминал текущей команды отличается от терминала предыдущей.

    13. Вывод не интересующих вас в настоящий момент элементов журнала, таких как время, имя терминала и других, можно отключить. Для этого нужно воспользоваться формой управления журналом вверху страницы.

    14. Небольшие комментарии к командам можно вставлять прямо из командной строки. Комментарий вводится прямо в командную строку, после символов #^ или #v. Символы ^ и v показывают направление выбора команды, к которой относится комментарий: ^ - к предыдущей, v - к следующей. Например, если в командной строке было введено:

      $ whoami
      
      user
      
      $ #^ Интересно, кто я?
      
      в журнале это будет выглядеть так:
      $ whoami
      
      user
      
      Интересно, кто я?

    15. Если комментарий содержит несколько строк, его можно вставить в журнал следующим образом:

      $ whoami
      
      user
      
      $ cat > /dev/null #^ Интересно, кто я?
      
      Программа whoami выводит имя пользователя, под которым 
      мы зарегистрировались в системе.
      -
      Она не может ответить на вопрос о нашем назначении 
      в этом мире.
      
      В журнале это будет выглядеть так:
      $ whoami
      user
      
      Интересно, кто я?
      Программа whoami выводит имя пользователя, под которым
      мы зарегистрировались в системе.

      Она не может ответить на вопрос о нашем назначении
      в этом мире.
      Для разделения нескольких абзацев между собой используйте символ "-", один в строке.

    16. Комментарии, не относящиеся непосредственно ни к какой из команд, добавляются точно таким же способом, только вместо симолов #^ или #v нужно использовать символы #=

    17. Содержимое файла может быть показано в журнале. Для этого его нужно вывести с помощью программы cat. Если вывод команды отметить симоволами #!, содержимое файла будет показано в журнале в специально отведённой для этого секции.
    18. Для того чтобы вставить скриншот интересующего вас окна в журнал, нужно воспользоваться командой l3shot. После того как команда вызвана, нужно с помощью мыши выбрать окно, которое должно быть в журнале.
    19. Команды в журнале расположены в хронологическом порядке. Если две команды давались одна за другой, но на разных терминалах, в журнале они будут рядом, даже если они не имеют друг к другу никакого отношения.
      1
          2
      3   
          4
      
      Группы команд, выполненных на разных терминалах, разделяются специальной линией. Под этой линией в правом углу показано имя терминала, на котором выполнялись команды. Для того чтобы посмотреть команды только одного сенса, нужно щёкнуть по этому названию.

    О программе

    LiLaLo (L3) расшифровывается как Live Lab Log.
    Программа разработана для повышения эффективности обучения Unix/Linux-системам.
    (c) Игорь Чубин, 2004-2008

    $Id$