| /l3/users/20-10-2014/NT-Ladm/debian1.net.nt/root :1 :2 :3 :4 |
|
|
#tail -20 user
From root@based-debian.net.nt Wed Oct 22 15:52:06 2014
Return-path: <root@based-debian.net.nt>
Envelope-to: user@based-debian.net.nt
Delivery-date: Wed, 22 Oct 2014 15:52:06 +0300
Received: from root by debian1.net.nt with local (Exim 4.80)
(envelope-from <root@based-debian.net.nt>)
id 1XgvOY-0003UM-59
for user@based-debian.net.nt; Wed, 22 Oct 2014 15:52:06 +0300
Date: Wed, 22 Oct 2014 15:52:06 +0300
To: user@based-debian.net.nt
Subject: Privet user
User-Agent: Heirloom mailx 12.5 6/20/10
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-Id: <E1XgvOY-0003UM-59@debian1.net.nt>
From: root <root@based-debian.net.nt>
privet
|
|
#cd
|
|
#cat hello.sh
#!/bin/bash
for c_user in $*
do
echo privet | mail -s "Privet $c_user" $c_user
done
|
|
#test -d 1
|
|
#test -d d1
|
|
#echo $?
1 |
|
#ls
hello.sh install ip i_p passwd source Tux.jpg wget.txt words xargs.txt |
|
#ls -a
. .aptitude .bash_profile hello.sh ip .l3rc .lilalo passwd source .vim .vimrc words .. .bash_history .bashrc install i_p .lesshst .links2 .profile Tux.jpg .viminfo wget.txt xargs.txt |
|
#test i_p
|
|
#echo $?
0 |
|
#test -d i_p
|
|
#echo $?
1 |
|
#[ -d i_p ]
|
|
#echo $?
1 |
|
#[ i_p ]
|
|
#echo $?
0 |
|
#cp no_file /tmp
cp: не удалось выполнить stat для «no_file»: Нет такого файла или каталога |
|
#echo $?
1 |
|
#touch no_file
|
|
#cp no_file /tmp/
|
|
#echo$?
l3script: echo0: команда не найдена |
|
#echo $?
127 |
|
#cp no_file /tmp/test 5 -gt 1
cp: неверный ключ -- g Попробуйте «cp --help» для получения более подробного описания. |
|
#test 5 -gt 1
|
|
#test 5 -lt 1
|
|
#echo $?
1 |
|
#test -z "$STRING"
|
|
#echo $?
0 |
|
#test "$P" !=print
l3script: test: : ожидается использование унарного оператора |
|
#test -e /etc/motd
|
|
#echo $?
0 |
|
#test -d /usr/local/bin/
|
|
#test -r /etc/shadow
|
|
#echo $?
0 |
|
#test -k /tmp/
|
|
#help test
test: test [expr]
Evaluate conditional expression.
Exits with a status of 0 (true) or 1 (false) depending on
the evaluation of EXPR. Expressions may be unary or binary. Unary
expressions are often used to examine the status of a file. There
are string operators and numeric comparison operators as well.
The behavior of test depends on the number of arguments. Read the
bash manual page for the complete specification.
File operators:
-a FILE True if file exists.
...
arg1 OP arg2 Arithmetic tests. OP is one of -eq, -ne,
-lt, -le, -gt, or -ge.
Arithmetic binary operators return true if ARG1 is equal, not-equal,
less-than, less-than-or-equal, greater-than, or greater-than-or-equal
than ARG2.
See the bash manual page bash(1) for the handling of parameters (i.e.
missing parameters).
Exit Status:
Returns success if EXPR evaluates to true; fails if EXPR evaluates to
false or an invalid argument is given.
|
|
#test -k /tmp/
|
|
#echo $?
0 |
|
#test -w /etc/passwd
|
|
#echo $?
0 |
|
#x=5
|
|
#y=10
|
|
#test x -gt y
l3script: test: x: integer expression expected |
|
#test $x -gt $y
|
|
#echo $?
1 |
|
#test $x -le $y
|
|
#echo $?
0 |
|
#echo "Your Lovely colour?" ; read FAV_COL ; \
> red Your Lovely colour? red l3script: red: команда не найдена |
|
#unset x,y
l3script: unset: `x,y': неправильный идентификатор |
|
#unset x y
|
|
#x
l3script: x: команда не найдена |
|
#set
BASH=/usr/local/bin/l3script BASHOPTS=checkwinsize:cmdhist:expand_aliases:extquote:force_fignore:hostcomplete:interactive_comments:progcomp:promptvars:sourcepath BASH_ALIASES=() BASH_ARGC=() BASH_ARGV=() BASH_CMDS=() BASH_LINENO=() BASH_SOURCE=() BASH_VERSINFO=([0]="4" [1]="2" [2]="37" [3]="1" [4]="release" [5]="x86_64-pc-linux-gnu") BASH_VERSION='4.2.37(1)-release' ... MACHTYPE=x86_64-pc-linux-gnu MAIL=/var/mail/root MAILCHECK=60 OLDPWD=/var/mail OPTERR=1 OPTIND=1 OSTYPE=linux-gnu PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin PIPESTATUS=([0]="127") PPID=9240 |
|
#set x
|
|
#a=0
|
|
#while [$a -lt 10]
> do > a=$((a+1)) > echo $a > done l3script: [0: команда не найдена |
|
#while [ $a -lt 10 ]; do a=$((a+1)); echo $a; done
1 2 3 4 5 6 7 8 9 10 |
|
#set a
|
|
#echo $a
10 |
|
#for file in /etc/*
> do > [ -r $file ] || echo $file > done |
|
#echo $?
0 |
|
#ls -l /etc/
итого 692 drwxr-xr-x 3 root root 4096 Окт 13 17:49 acpi -rw-r--r-- 1 root root 2981 Июн 27 10:59 adduser.conf -rw-r--r-- 1 root root 44 Окт 15 16:25 adjtime -rw-r--r-- 1 root root 196 Июн 27 11:18 aliases drwxr-xr-x 2 root root 4096 Окт 22 14:32 alternatives drwxr-xr-x 6 root root 4096 Окт 13 17:45 apt -rw-r--r-- 1 root root 1910 Окт 21 14:32 bash.bashrc -rw-r--r-- 1 root root 45 Июн 17 2012 bash_completion drwxr-xr-x 2 root root 4096 Июн 27 11:18 bash_completion.d ... -rw-r--r-- 1 root root 12 Июн 27 11:57 timezone -rw-r--r-- 1 root root 1552 Окт 19 2012 trafshow -rw-r--r-- 1 root root 1260 Май 30 2008 ucf.conf drwxr-xr-x 4 root root 4096 Июн 27 10:59 udev drwxr-xr-x 3 root root 4096 Июн 27 11:52 ufw drwxr-xr-x 2 root root 4096 Июн 27 10:59 vim drwxr-xr-x 2 root root 4096 Июн 27 12:01 w3m -rw-r--r-- 1 root root 4496 Фев 1 2014 wgetrc drwxr-xr-x 3 root root 4096 Июн 27 11:00 X11 drwxr-xr-x 2 root root 4096 Июн 27 12:00 xml |