Installation of Ubuntu 14
Installation of Ubuntu 14
Installation of Ubuntu 14
1. INSTALLATION OF UBUNTU 14
4) Installation Type
This step is important one but simple. For Fresh installation choose first option Erase disk
and install Ubuntu and it will erase whole disk and create partition table automatically
then move forward. If you choose fourth option something else and it will also erase
wholedisk but need to create partition table manually then move forward.
Its fresh installation, so I’m choosing first option and hit Install Now
8) Copying files
Ubuntu Installer now copying all the system files to your hard disk.
Linux distributions are primarily based on free and open-source software. There are
currently over six hundred Linux distributions. The some Linux distributions are discussed here.
1. Mandriva
2. Ubuntu
3. Redhat
4. Fedora
5. SUSE
6. Debian
Mandriva
Mandriva Linux (formerly Mandrake Linux) is a Red Hat-based operating system created by the
French software company Mandriva (formerly Mandrakesoft). It is the result of the technical
merging of the former Mandrake Linux and Conectiva distributions. Mandriva is released in
both desktop and server flavors. The latest version is Mandriva Linux 2011, "Hydrogen".
Mandriva provides multiple editions of Linux. Some were freely distributable until 2012, while
now they are only sold online and via a network of authorized resellers. Prior open source code
of the old Mandriva Free was later forked into free derivatives like Mageia
and OpenMandriva Lx.
Ubuntu
The vision for Ubuntu is part social and part economic: free software, available to everybody on
the same terms, and funded through a portfolio of services provided by Canonical.
Ubuntu is different from the commercial Linux offerings that preceded it because it doesn't
divide its efforts between a high-quality commercial version and a free 'community' version.
The commercial and community teams collaborate to produce a single, high-quality release,
which receives ongoing maintenance for a defined period. Both the release and ongoing
updates are freely available to all users.
The first official Ubuntu release -- Version 4.10, codenamed the 'Warty Warthog' — was
launched in October 2004, and sparked dramatic global interest as thousands of free software
enthusiasts and experts joined the Ubuntu community.
Ubuntu today has eight flavors and dozens of localized and specialized derivatives. There are
also special editions for servers, OpenStack clouds, and mobile devices. All editions share
common infrastructure and software, making Ubuntu a unique single platform that scales from
consumer electronics to the desktop and up into the cloud for enterprise computing.
Red hat
Red Hat was one of the first companies to realize that "free" software could be sold as a
product. After examining the successful marketing campaign of Evian water, Red Hat concluded
that to achieve success, the company had to create more Linux users and brand Red Hat as the
Linux name that customers preferred. Today, the "Red Hat Plan" is discussed as a model in
business schools.
The advantage to buying the distribution from Red Hat, rather than assembling it yourself at no
cost, is the support you receive. Red Hat offers services that aren't provided as quickly by
individual component developers, including members of the Free Software Foundation. Like all
free software, Red Hat's packages allow the buyer to modify and even resell modified versions
of code as long as they do not restrict anyone else from further modification.
Red Hat provides over 400 different software packages, including the C language compiler from
Cygnus, a Web server from Apache, and the X Window System from X Consortium.
Fedora
Fedora has a relatively short life cycle: version X is supported only until 1 month after version
X+2 and with approximately 6 months between versions, this means that a version of Fedora is
supported for approximately 13 months. This promotes leading-edge software because it frees
developers from some backward compatibility restraints, but it also makes Fedora a poor
choice for product development, which usually requires long-term vendor-support. Fedora
users can upgrade from version to version using FedUp
Fedora comes installed with a wide range of software such as LibreOffice and Firefox.
Additional software is available from the software repositories and can be installed using the
yum or dnf package managers with graphical interfaces, such as GNOME Software, also being
available.
Suse
Starting with the launch of the SUSE Linux Enterprise 10 platform in July 2006, the SUSE Linux
Enterprise 10 platform was the basis for both the server and desktop with an almost identical
code base.
Debian
Debian (/ˈdɛbiən/) is an operating system which is composed primarily of free software, most
of which is under the GNU General Public License, and developed by a group of volunteers
which relies on the Internet to collaborate. This collective group of individuals is known as the
Debian project. Debian is one of the most popular Linux distributions for personal computers
and network servers, and has been used as a base for several other Linux distributions.
Debian 6.0 introduced support for a new kernel aside from the Linux kernel: the kFreeBSD
kernel. This project's new kernel is released as a technology preview and still lacks the amount
of software available in Debian's Linux distribution. GNU/kFreeBSD is offered for Intel/AMD 32-
bit and 64-bit architecture machines. Debian now supports two kernels, Linux and kFreeBSD,
and offers GNU Hurd unofficially.
Syntax
ls [OPTION]... [FILE]...
Option Description
Example:
$ ls -l
Output:
total 8
drwxrwxr-x 2 it it 80 Aug 20 12:13 linux
-rw-rw-r-- 1 it it 9 Aug 20 12:10 LinuxLabCycle.docx
drwxrwxr-x 2 it it 40 Aug 20 12:02 networking
drwxrwxr-x 2 it it 40 Aug 20 12:01 php
-rw-rw-r-- 1 it it 10 Aug 20 12:11 PhpLabCycle.docx
-r reverse order while sorting
Example::
$ ls -r
Output::
PhpLabCycle.docx php networking LinuxLabCycle.docx linux
Example:
ls -R
Output:
./linux:
mod1.docx mod2.pdf
./networking:
./php:
Example:
ls -s
Output:
total 8
0 linux 4 LinuxLabCycle.docx 0 networking 0 php 4
PhpLabCycle.docx
Example:
ls -c
Output:
linux PhpLabCycle.docx LinuxLabCycle.docx networking php
Example:
ls -m
Output:
linux, LinuxLabCycle.docx, networking, php,
PhpLabCycle.docx
2.grep
Syntax
grep [OPTIONS] PATTERN [FILE...]
Option Description
Example:
$ grep -v a f1
Output:
ANju
dEEpu
ACHU
AniL
-c Suppress normalOutput; instead print a count of matching lines for each input file.
Example:
~$ grep -c A f1
Output:
3
Example:
~$ grep -i e f1
Output:
meera
meera
dEEpu
Example:
~$ grep ra -o f1
Output:ra
ra
-n Prefix each line of Output: with the 1-based line number within its input file.
Example:
~$ grep -n a f1
Output:
1:meera
2:Susan
3:meera
6:aCHU
-l Suppress normal Output; instead print the name of each input file from
which Output:would normally have beenprinted.
Example:
~$ grep -l a f1 f2
Output:
f1
f2
-L Suppress normaloutput; instead print the name of each input file from which no output
would normally have been printed.
Example:
~$ grep -L meera f1 f2
Output:
f2
-w Select only those lines containing matches that form whole words.
Example:
~$ grep -w meera f1 f2
Output:
f1:meera
f1:meera
3.rm
Syntax
rm [OPTION]... FILE...
Option Description
Example:
~$ rm -i f3
Output:
rm: remove regular file „f3‟? y
Example:
~$ rm -f f5
Example:
~$ rm -v -r flag
Output:
removed directory: „flag‟
Example:
~$ rm -v f2
Output:
removed „f2‟
4. wc
Syntax
wc [OPTION]... [FILE]...
Option Description
Example:
~$ wc -c f1
Output:
44 f1
-m print the character counts.
Example:
~$ wc -m f2
Output:
19 f2
Example:
~$ wc -l f2
Output:
7 f2
Example:
~$ wc -L f1
Output:
5 f1
Example:
~$ wc -w f1
Output:
8 f1
5.pwd
Syntax
pwd [OPTION]...
Example:
~$ pwd
Output:
/home/chinjunv
6. cat
Syntax
Option Description
-A equivalent to -v
Example:
~$ cat -A f2
Output:anu$
govind$
radhu$
jiji$
lolitta$
appu$
-b number nonempty output lines, overrides –n.
Example:
~$ cat -b f2
Output:
1 anu
2 govind
3 radhu
4 jiji
5 lolitta
Example:
~$ cat -s f4
Output:
devu
sain
binu
Example:
~$ cat -E f1
Output:
meera$
Susan$
meera$
ANju$
dEEpu$
aCHU$
ACHU$
AniL$
Example:
~$ cat -n f2
Output:
anu
govind
radhu
jiji
lolitta
7.date
Syntax
Option Description
Example:
~$ date --date='15 days ago'
Output:
Fri Sep 5
Example:
~$ date -r f3
Output:
Sat Sep 20 13:12:50 IST 2014
Example:
~$ date –u
Output:
Sat Sep 20 07:54:11 UTC 2014
Example:
~$ date -R
Output:
Sat, 20 Sep 2014 13:25:16 +0530
8. mv
Syntax
Option Description
Example:
~$ mv f newfile
Example:
~$ mv -f newfile
Example:
~$ mv -i f newfile
Output:
mv: overwrite „newfile‟? y
Example:
mv -n newfile file
Example:
~$ mv -v filelinux
Output:
„file‟ -> „linux‟
9. cat
Syntax
Example:
~$ cat linux
Output:
file
directory
bash
ash
zsh
Option Description
-A show all
Example:
~$ cat -A linux
Output:file$
directory$
bash$ ash$
Example:
~$ cat -b flower
Output:
1 rose
2 jasmine
3 lotus
4 lilly
Example:
~$ cat -b -s flower
Output:
1 rose
2 jasmine
3 lotus
4 lilly
Example:
~$ cat -n flower
Output:
1 rose
2 jasmine
3 lotus
4 lilly
Example:
$ cat -E flower
Output:rose$
$
$
$
jasmine$
lotus$
$
$
lilly$
$
10. head
Syntax
Option Description
Example:
~$ head -c 10 linux
Output:
File
Example:
~$ head -2 linux
Output:file
directory
Example:
~$ head -q linux
Output:file
directory
bash
ash
11. tail
Syntax
Option Description
Example:
~$ cat linux
Output:
file
directory
bash
ash
Example:
~$ tail -c 3 linux
Output:
sh
Example:
~$ tail –f linux
Output:file
directory
bash
ash
new data
Example:
~$ tail -3 linux
Output:directory
bash
ash
12. paste
Syntax
Option Description
Example:
linux
Output: new
new
exam
exam
Example:
~$ paste -s linux
Output:
file directory bash ash
13. file
Syntax
Option Description
Example:
~$ file -b flower
Output:
ASCII text
Example:
~$ file -c flower
Output:
cont offset type opcode mask value desc
-e exclude the test named in testname from the list of tests made to determine the
file type
Example:
~$ file -e ascii flower
Output:
flower: data
-F Use the specified string as the separator between the filename and the file
result returned. Defaults to ‘:’
Example:
~$ file -F @ flower
Output:
flower@ ASCII text
14. chmod
Syntax
Option Description
Example:
chmod o-rf1
Output:
-rwxrw---- 1 lb233 lb233 10 Jan 8 16:10 f1
15.cp
Syntax
Example:
cat>>file1
12
13
cat>>file2
flag color
Example:
cp file1 file2
cat file2
Output:
12
13
16.tee
read from standard input and write to standard Output: and files
Syntax
Option Description
Example:
tee -a f1
apple
orange
Output:
1
2
3
4
5
apple
orange
17.tr
translate or delete characters
Syntax
tr [OPTION]... SET1 [SET2]
Example:
tr "[a-z]" "[A-Z]" <f2
Output:
A
B
C
D
E
18.echo
display a line of text
Syntax
echo [SHORT-OPTION]... [STRING]...
echo LONG-OPTION
Example:
echo sree narayana gurukulam
Output:
sree narayana gurukulam
19.sort
sort lines of text files
Syntax
sort [OPTION]... [FILE]...
Option Description
Example:
cat>>f5
Output:
debian
suse
fedora
mandriva
redhat
Example:
sort -n f5
Output:debian
fedora
mandriva
redhat
suse
20. find
find - search for files in a directory hierarchy
Syntax
Option Description
Example:
find /home/mca/India -type d
Output:
/home/mca/India
/home/mca/India/bharat
Example:
find /home/mca -name f?
Output:
/home/mca/India/f1
/home/mca/India/f2
/home/mca/f4
21. pipe
the standard output of one command can be send on standard input to another command
Example:
cat f2 | tee mca
Output:
Unix
Redhat
Fedora
Open SUSE
Example:
cat f2 | head -3 | tail -1
Output:
3. Fedora
22.chown
Syntax
chown [OPTION]... [OWNER][:[GROUP]] FILE...
chown [OPTION]... --reference=RFILE FILE...
Option Description
Example:
sudo chown mca
f2 ls -l
Output:
-rw-rw-r-- 1 mca mca 41 Jan 8 20:39 f2
4.SHELL
PROGRAMMING
PROGRAM NO:1
DATE: 14-07-2015
AIM
The length & breadth of a rectangle & radius of a circle are input through the keyboard.
Write a shell program to calculate the area & perimeter of rectangle, and the area &
circumference of the circle.
PROGRAM
echo "area of
rectangle=" area_=`echo
"$l*$b"|bc` echo $area_
echo "Perimeter of
rectangle=" s=`echo "$l +
$b"|bc` pr=`echo "$s * 2"|bc`
echo $pr
echo "Circumference of
circle" cir=`echo "2 * 3.14 *
$r "|bc` echo $cir
OUTPUT
lb245@lb245:~/reenu$ bash
Enter radius of
circle 34
Dept. Of Computer Applications ,SNGCE
PROGRAM NO:2
DATE: 21-07-2015
AIM
7. Write a shell program to read marks scored in 3 subjects (out of 100). Calculate
the percentage of marks & display the grade based on the following conditions.
% Grade
80-100 A
70-79 B
60-69 C
<=59 D(Failed)
PROGRAM
OUTPUT
GRADE OF STUDENTS
enter 3 marks
56
78
89
TOTAL MARK= 223
PERCENTAGE= 74
B grade
PROGRAM NO:3
DATE: 31-05-2015
AIM
Write a script that receives year as argument and check whether it is leap year. If no
argument is given assume the current year.
PROGRAM
year=$1
11. if [ $# -eq 0 ]
12. then
13. year=2015
14.
15. fi leap=$(($year
% 4))
l=$(($year%100))
a=$(($year%400))
0 ] then
Dept. Of Computer Applications ,SNGCE
then
else
fi
OUTPUT
lb245@lb245:~/reenu$ bash
PROGRAM NO:4
DATE:28-07-2015
AIM
PROGRAM
echo "NUMBER=$n"
n1=$n
s=0
while [ $n -gt 0
] do
r=`echo "$n%10"|bc`
s=`echo "($s*10)+$r"|bc`
n=`echo "$n/10"|bc`
done
if [ $n1 -eq $s ]
then
echo
"palindrome" else
fi
s1=0
] do
r1=`echo "$n1%10"|bc`
s1=`echo "$s1+$r1"|bc`
n1=`echo "$n1/10"|bc`
OUTPUT
567
NUMBER=567
reverse is 765
not palindrome
sum of digit=18
121
NUMBER=121
reverse is 121
palindrome
sum of digit=4
PROGRAM NO:5
DATE:01-09-2015
AIM
Write a shell script that receives any number of file names as arguments checks if
every argument supplied is a file or a directory and reports accordingly. Whenever
PROGRAM
OUTPUT
PROGRAM NO:6
DATE: 11-08-2015
AIM
Write a shell program to display Fibonacci series using any looping construct.
PROGRAM
echo $f1
fsum=$((f1+f2))
f1=$f2
f2=$fsum
Dept. Of Computer Applications ,SNGCE
OUTPUT
lb245@lb245:~/reenu$ bash
fib.sh Enter the number
5
result:
0
1
1
2
3
PROGRAM NO:7
DATE: 18-08-2015
AIM
Write a shell program to find out reverse string of the given string and check the given
string is palindrome or not.
PROGRAM
OUTPUT
lb245@lb245:~/reenu$ bash
palin.sh Enter the string
ini
palindrome
Dept. Of Computer Applications ,SNGCE
PROGRAM NO:8
DATE: 04-09-2015
AIM
PROGRAM
done
if [ $f -eq 1
] then
echo "The given element $m is present at
position $i " else
echo "The element $m not present"
fi
OUTPUT
PROGRAM NO:9
DATE: 18-08-2015
AIM
Write a shell program to sort the given numbers in ascending order using bubble sort
PROGRAM
OUTPUT
lb245@lb245:~/reenu$ bash
BubbleSort.sh enter the limit of array
9
enter the
elements 12 99
63 12 8 1 75 54
63
sorted numbers
are 1 8 12 12 54
63 63 75 99
PROGRAM NO:10
DATE: 04-09-2015
AIM
Write a shell script to display the digits which are in odd position in a given 5 digit number
number" read x
1 ] then
n=1
while [ $n -le 5
] do
a=`echo $x | cut -c
$n` echo $a
n=`expr $n +
2` done
else
number" fi
OUTPUT
58943
PROGRAM NO:11
DATE: 30-09-2015
Dept. Of Computer Applications ,SNGCE
AIM
Write script that takes a number as command line argument and prints its table in
below
format: 2 * 1 = 2
2*2=4
…
2 * 10 = 20
Write a shell script called compare.sh that takes two integers, compares them and
does the following : add them if the first one is smaller than the second, multiply them
if the first one is greater than the second and do nothing if they are equal.
PROGRAM
while [ 1
] do
read c
case $c in
table" read x
2) bash compare.sh;;
3) exit;;
esac
numbers" read x
read y
if [ $x -gt $y
] then
r=$((x*y))
echo "$x * $y =
then
a=$((x+y))
echo "$x + $y =
$a" else
same" fi
if [ $# -eq 0
] then
echo "enter
argument" exit;
else
n=$1;
fi
do
p=$((n*i));
echo "$n * $i =
$p" done
compare.sh
numbers" read x
read y
if [ $x -gt $y
] then
r=$((x*y))
echo "$x * $y =
then
a=$((x+y))
echo "$x + $y =
$a" else
same" fi
mul.sh
if [ $# -eq 0 ]
echo "enter
argument" exit;
else
n=$1;
fi
for ((i=1;i<=10;i++))
do
p=$((n*i));
echo "$n * $i =
$p" done
OUTPUT
lb245@lb245:~/reenu/cycle4$ bash
1. Multiplication table
2. Number checking
3. Exit
table 5 5 * 1 = 5
5 * 2 = 10
5 * 3 = 15
Dept. Of Computer Applications ,SNGCE
65
5 * 4 = 20
5 * 5 = 25
Dept. Of Computer Applications ,SNGCE
5 * 7 = 35
5 * 8 = 40
5 * 9 = 45
5 * 10 = 50 Enter
your choice
1. Multiplication table
2. Number checking
3. Exit
enter two
numbers 9 8
9 * 8 = 72
1. Multiplication table
2. Number checking
3. Exit
enter two
numbers 1 9
1 + 9 = 10
1. Multiplication table
3. Exit
PROGRAM NO:12
DATE: 30-09-2015
AIM
PROGRAM
limit" read n
s=0
for((i=1;i<=n;++i))
do
f=1
for((j=1;j<=i;++j))
do
f=$((f*j))
done
-l` done
OUTPUT
sum is 2.70
PROGRAM NO:13
DATE: 30-09-2015
AIM
Write an alternative script for the command tail called TAIL which works exactly
like tail command with options. (Do not use tail command in the script).
PROGRAM
if [ $# -ne 0
] then
if [ -e $1
] then
1 ` if [ $# -eq 2 ]
then
d=$(($c-$2))
d=$(($d+1))
$1 elif [ $# -eq 1 ]
then
Dept. Of Computer Applications ,SNGCE
71
s=$(($c-10))
s=$(($s+1))
fi
else
exist" fi
else
fi
OUTPUT
f2 .txt
**************
reenu COLORS
yellow
blue
green
reenu
sky
is
blue
roses
violet
green
orange
silver
lb245@lb245:~/reenu/cycle4$ bash
4_6.sh f2 6 r
red
violet
green
orange
silver
PROGRAM NO:14
DATE: 30-09-2015
AIM
Write an alternative script for the command head called HEAD which works exactly
like head command with options. (Do not use head command in the script).
PROGRAM
if [ $# -ne 0
] then
if [ -e $1
] then
1 ` if [ $# -eq 2 ]
then
$1 elif [ $# -eq 1 ]
then
fi
else
exist" fi
else
fi
OUTPUT
f2 .txt
**************
reenu COLORS
yellow
blue
green
reenu
sky
blue
roses
r
red
violet
green
orange
silve
**************
reenu COLORS
yellow
blue
green
reenu
PROGRAM NO:15
DATE: 30-09-2015
AIM
PROGRAM
for ((i=1;i<=3;i++))
do
((j=1;j<=3;j++)) do
for ((k=1;k<=3;k++))
do
$k ] then
echo $i $j
$k fi
done
done
done
OUTPUT
lb245@lb245:~/reenu/cycle4$ bash
4_8.sh f2 6 1 2 3 1 3 2 2 1 3 2 3 1 3 1 2 3
21
PROGRAM NO:16
DATE: 30-09-2015
AIM
The word Unix is present in only some of the files supplied as arguments to the shell script.
Your shell script should search each of these files in turn & stop at the first file that
encounters containing the word Unix. This filename should be displayed on the screen.
Dept. Of Computer Applications ,SNGCE
PROGRAM
x=$*
for i in $x
do
$i if [ $? -eq 0 ]
then
echo $i
break
fi
done
OUTPUT
f2.txt
**************
reenu COLORS
yellow
blue
green
reenu
sky
is
blue
roses
red
violet
green
orange
silver
new.txt
COLORS
yellow
blue
f3
PROGRAM NO:17
DATE: 30-09-2015
AIM
12
123
12 3 4
PROGRAM
limit" read n
;i++)) do
;j++)) do
done
done
OUTPUT
12
123
1234
12345
PROGRAM NO:18
Dept. Of Computer Applications ,SNGCE
DATE: 30-09-2015
AIM
PROGRAM
while [ 1 ]
do
read c
case $c in
number" read a
b=
n=$a
while [ $a -ne 0
] do
d=$(expr $a %
2) b=$d$b
a=$(expr $a / 2)
done
number" read a
b=
n=$a
while [ $a -ne 0
] do
d=$(expr $a %
8) b=$d$b
a=$(expr $a / 8)
done
echo $b;;
number" read a
b=
n=$a
while [ $a -ne 0
] do
d=$(expr $a % 16)
if [ $d == 10 ]
then
d=A
elif [ $d == 11 ]
then
Dept. Of Computer Applications ,SNGCE
elif [ $d == 12 ]
then
d=C
elif [ $d == 13 ]
then
d=D
elif [ $d == 14 ]
then
d=E
elif [ $d == 15 ]
then
d=F
fi
b=$d$b
a=$(expr $a / 16)
done
echo $b;;
4)exit;;
esac
done
OUTPUT
lb245@lb245:~/reenu/cycle5$ bash
1. Binary
3. Hexadecimal
4. exit
number 45 101101
1. Binary
2. Octal
3. Hexadecimal
4. exit
number 45 55
1. Binary
2. Octal
3. Hexadecimal
4. exit
number 45
2D
2. Octal
3. Hexadecimal
4. exit
PROGRAM NO:19
DATE: 30-09-2015
AIM
Write a shell script to perform database operations for student data like view, add
and delete records and view database.
PROGRAM
" read db
while [ 1 ]
do
read c
case $c in
1)cat $db;;
read id
cat dbs1;;
4)exit;;
";; esac
done
OUTPUT
lb245@lb245:~/reenu/cycle5$ bash
document
1. View
2. Add Records
3. Delete Records
4. Exit
45
reenu
mca-le
Enter college
name sngce
1. View
2. Add Records
3. Delete Records
4. Exit
Enter your
choice 1
1. View
2. Add Records
3. Delete Records
4. Exit
Enter your
choice 1
1. View
2. Add Records
3. Delete Records
Dept. Of Computer Applications ,SNGCE
Enter your
choice 2
jo
cs
Enter college
name sngce
1. View
2. Add Records
3. Delete Records
4. Exit
Enter your
choice 1
2 jo cs sngce
1. View
2. Add Records
3. Delete Records
4. Exit
Enter your
choice 3
Enter Id
Dept. Of Computer Applications ,SNGCE
Record is deleted
2 jo cs sngce
1. View
2. Add Records
3. Delete Records
4. Exit
Enter your
choice 1
2 jo cs sngce
1. View
2. Add Records
3. Delete Records
4. Exit
Enter your
choice 1
2 jo cs sngce
1. View
2. Add Records
3. Delete Records
4. Exit
PROGRAM NO:1
Dept. Of Computer Applications ,SNGCE
DATE: 30-09-2015
AIM
Write a script to read the basic salary of n employees and calculate the gross
salary If BP<15000, DA=30% of BP, HRA =Rs 500. TA = 10% of BP.
If BP >=15000, DA=50% of BP, HRA=15%, TA=1000.
PROGRAM
limit" read n
emp" for((i=0;i<n;i++))
do read
sal[i]=$s
done
for((i=0;i<n;i++))
do
bs=${sal[i]}
echo
then
da=$((bs*30/100))
ta=$((bs*10/100))
hra=500
else
da=$((bs*50/100))
hra=$((bs*15/100))
ta=1000
gs=$((bs+da+ta+hra))
fi
done
OUTPUT
lb245@lb245:~/reenu/cycle5$ bash