-
Notifications
You must be signed in to change notification settings - Fork 73
/
Copy path1.Document-scripts-for-introduction-to-loops.txt.txt
69 lines (55 loc) · 1.33 KB
/
1.Document-scripts-for-introduction-to-loops.txt.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
========================================
intro_loops.sh
#!/bin/bash
for each in 1 2 3 4 5
do
echo "Welcome to shell scripting"
echo "We done with very basics"
echo "Now we are starting loops concepts"
done
===========================================
check_ex_per.sh
#!/bin/bash
<< com
if [[ -x httpd_info.sh ]]
then
echo "httpd_info.sh is having execution permission"
else
echo "httpd_info.sh is not having execution permission"
fi
if [[ -x httpd_ver_port.sh ]]
then
echo "httpd_ver_port.sh is having execution permission"
else
echo "httpd_ver_port.sh is not having execution permission"
fi
com
#for each in httpd_info.sh httpd_ver_port.sh check_ex_per.sh
for each in $(ls)
do
if [[ -x $each ]]
then
echo "$each is having execution permission"
else
echo "$each is not having execution permission"
fi
done
======================================================================
check_ex_per_of_files_for_given_dir.sh
#!/bin/bash
if [[ $# -ne 1 ]]
then
echo "Usage: $0 <any_path>"
exit
fi
given_path=$1
for each in $(ls $given_path)
do
if [[ -x $each ]]
then
echo "$each is having execution permission"
else
echo "$each is not having execution permission"
fi
done
========================================================