Вы находитесь на странице: 1из 2

Nr.

6
shell UNIX OS
1.

, :
___________ ___________________________________________________

2.
shell, ,
( , 3-4 ), :

$ # print x,y ; $ # comment


$ HOME=/usr/marija ; $ TERM=xterm ; $ TZ=PST2EDT ;
$ PATH=/bin:/usr/bin:.:/usr/local/bin:/usr/bin/X11
[ $a = $b ] ; [ $a != $b ]
$ echo Privet ; $ test r file ; $ read name
$ if list1 then list2 else list3 fi ; $ while list1 do list2 done ;
$ kill -9 pid; $ kill -HUP 172; $ nice n 15 mplayer ; $ renice +13
64

3. :
chmod 775 script
list=student
list=my$list
sorting=$(list)sort
echo $name
S=ls lit
$S

$now=`date`
now=$(date)

rwxrwxr-x script
list student
list mystudent
sorting mystudent + sort
name
S ls -lit
ls -lit
(-l),
i-node, (-i)
(-t)
,
now date ( )

4. shell UNIX OS.


(
):
test -
$ test r file
[] - test
$ if [...]
Set - , ( ,
) $ set history = 30
env -
$ env | grep r file
unset - , ,

$ unset editor
break -
$ break 1
continue -
$ continue 1
read - (stdin),

$ read name
return - n. n ,
.
$ return 1
times - $ time ls
function - .
$ Hello () {echo "Hello World"}

for -
$ for var
if -
$ if list1 then list2 else list3 fi
while - do,
0
$ while list1 do list2 done
until - while, - ; $ until list1 do list2
done
case -
, , $ case-2 Hello
select - _ in,

$ select var 1 2
5. , count.txt,
(, for).
wc -l * 1> count.txt
6.
task6.txt (, vi).
, , , .
,
. ,
.

a.txt, b.txt, c.txt
,
.
first second
a.txt first
my.dat
,
txt second

second, a

echo cd >> task6.txt


echo touch a.txt b.txt c.txt >> task6.txt
echo ls >> task6.txt
echo mkdir first second >> task6.txt
echo cat a.txt | first/ my.dat >> task6.txt
echo mv *.txt second >> task6.txt
echo find second *a* >> task6.txt
echo cd $OLDPWD > > task6.txt

Вам также может понравиться