Linux
Linux
The AWK test – processing language is useful for such task as:-
Tallying information from text files and creating reports from the
result.
Adding additional functions to the text editors like “Vi”
Translating files from one format to another
Creating small databases.
Perform Mathematical operation on files of numeric data.
AWK Program
1) AWK program to convert temperature.
BEGIN
getline f;
C= (5/9) * (f-32);
print “temperature in”c;
getline num;
i=1;
for(i=1;i<=num;i++)
if (i%2==0)
print i
Results:-
PERL Program
1) # Perl to find factorial of given number.
print “input number for factorial”;
#num = <stdin>;
$fact=1;
for($i=1;$i<$num;$i=$i+1)
{
$fact=$fact*$i;
}
print “factorial of $num is %fact”;