Shell program to compression and decompression of files using gzip and gunzip
clear echo "enter the file name" read fname echo "size of $file name before compression is" wc -c $fname gzip $fname echo "size of file name after compression" wc -c…
q
clear echo "enter the file name" read fname echo "size of $file name before compression is" wc -c $fname gzip $fname echo "size of file name after compression" wc -c…
clear hours=`date|cut -c12-13` if [ $hours -le 12 ] then echo "Good Morning" else if [ $hours -le 16 ] then echo "Good Afternoon" elif [ $hours -le 20 ]…
clear echo "enter the string" read str len=`expr $str | wc -c` len=`expr $len - 1` while [ $len -gt 0 ] do ch=`echo $str | cut -c $len` echo…
clear sum=0 i="y" echo " Enter one no." read n1 echo "Enter second no." read n2 while [ $i = "y" ] do echo "1.Addition" echo "2.Subtraction" echo "3.Multiplication" echo…
clear echo "Enter two intergers" read m n echo " To find GCD and LCM" echo "====================" echo "given two numbers are" echo "m= $m and n=$n" temp=`expr $m *…
Program: if the number divided by 2 the such number is even otherwise odd clear echo "enter a number" read n if [ `expr $n % 2` -eq 0 ];…
Concept:Cat: cat command is used to create the fileSyntax: cat > file name for creationSyntax: cat file name for displaying a fileSed: sed means stream editor it can be used for editing…
#include #include #include int main() { int pid,status; char comd[20];pid=fork(); if(pid==0) { printf("child processn"); while(strcmp(comd,"exit")!=0) { printf("[user@localhost~]$"); gets(comd); system(comd); } exit(0); } else { wait(&status); printf("parent processn"); } } ****************************************…
#!/bin/sh str=tanu echo “string:$str” echo “lengh of string:” z=`expr “$str”:’.*’` echo $z echo “substring is” z=`expr “$str”:’.*(…)’` echo $z echo “position of character n is” z=`expr “$str”:’[^n]*n’` echo $z *******************…