Scriptelés alapok

Transcription

Scriptelés alapok
Utolsó módosítás: 2012. február 13.
1
2
3
4
5
6
7
8
9
#!/bin/cat
echo "Hello World";
10
11
12
13
14
15
16
17
18
#!/bin/bash
VAR1=Ertek
VAR2=4
var3=8
VAR4=3
echo "$VAR1 $VAR2 $var3";
echo '$VAR1 $VAR2 $var3';
echo "${VAR4}. Évfolyam";
echo ${VAR1} ${VAR2}${var3};
#!/bin/bash
echo ${HELLO}
HELLO=`./HelloWorld.sh`;
echo ${HELLO};
unset HELLO;
echo ${HELLO};
19
20
21
22
23
24
25
26
#!/bin/bash
wget -O - -q -t 1 http://inf.mit.bme.hu
RETURNCODE=$?;
if [ $RETURNCODE -eq 5 ]; then
echo "Baj van. Hibakód: $RETURNCODE";
else
echo "Ok";
fi
27
28
29
#!/bin/bash
HEADERS=Files/*.h
echo $HEADERS;
for a in $HEADERS; do
echo $a;
cat $a | grep "#define";
done;
#!/bin/bash
OLDIFS=$IFS
IFS=":";
cat /etc/passwd | grep "/bin/sh" | while read line; do
for a in $line; do
echo $a;
done;
done;
IFS=$OLDIFS;
30
31
32
33
34
35
36
37
38
39
40
cat kutya.txt | sed "s/kutya/macska/g"
41
42
43
44
45
46
47
48
49
50
51
52
53

Similar documents