Shell program to check whether a file exists in a directory or not
!/bin/bash if [ -f $1 ] then echo " $1 File exist " else echo " File does not exist " fi
Hello guys, I am Dreek. In this blog, I will post programs in various languages which will be useful for students.
!/bin/bash if [ -f $1 ] then echo " $1 File exist " else echo " File does not exist " fi
!/bin/bash echo " Enter the lenght of series " read n t1=0 t2=1 s=`expr $t1 + $t2` echo " $s " for((i=0;i<n...
!/bin/bash read -p "Enter a sentence " s a=$( echo $s | tr -cd 'AaEeIiOouU' | wc -c) echo " Number of vowels $...
!/bin/bash echo " Enter a number " read a echo " Enter another number " read b echo " Enter your choice 1....
GNU nano 2.9.3 prime !/bin/bash echo "Enter a number" read n for...
!/bin/bash echo "Enter a number" read n s=1 for((i=1;i<=n;i++)) do s=`expr $s \* $i` done echo "Factori...
!/bin/bash if [ $1 -gt $2 -a $1 -gt $3 ] then echo " $1 is largest " elif [ $2 -gt $3 ] then echo " $...
#!/bin/bash echo "Enter the first number" read a echo "Enter the second number" read b c=`expr $a + $b` echo ...