Shell program to find LCM and hcf of two no.s tput clear echo "Enter first no" read a echo "Enter 2nd no" read b p= 'expr $a \* $b' while [$b -ne 0] do r= 'expr $a % $b' a=$b b=$r done LCM = 'expr $p / $a' echo "LCM = $LCM" echo "Hcf = $a"
All elements in Group 7 have the same number of electrons in their outermost shell and this number corresponds to the group number.
i=2 rem=1 echo -e "Enter a number: \c" read num if [ $num -lt 2 ]; then echo -e "$num is not prime\n" exit 0 fi while [ $i -le `expr $num / 2` -a $rem -ne 0 ]; do rem=`expr $num % $i` i=`expr $i + 1` done if [ $rem -ne 0 ]; then echo -e "$num is prime\n" else echo -e "$num is not prime\n" fi
twice of the value of circular tolerance
On a computer Bash is a Unix shell and command language.
Well the question is not particularly specific. I assume that we are talking about shell and in this example I would refer to "bash" shell. #!/bin/bash echo $1 this simple script will print first parameter passed to it.
That would depend on what shell you're using. Most seem to have a command similar to "echo x" which will print x to the terminal.
Use the builtin 'echo' or 'print' command followed by the shell variable name, which will substitute the value when printed/displayed.
You don't need a shell script to do this; use the 'grep' command with the '-c' option to count the number of occurrences of some pattern.
If the shell script is readable and executable then to execute it just type the name of the shell script file. Otherwise, you can explicity call a shell interpreter to run the file as a shell script, i.e., ksh myfile
Improve $vi multable.sh echo "enter the value of n:" read n i=1 for((i=1;i<=10;i++)) do echo " $n * $i = `expr $n \* $i`" done
No, the shell needs both execute and read permissions to run the script.
use python, shell is stupid
You don't need a shell script for that; use either 'whoami' or 'id'
awk 'BEGIN {FS=OFS=":"} {temp=$1; $1=$2; $2=temp} {print}' File1.txt
There are following shell scripts available at the below mentioned url -1. Shell Script for Log4j Log Analysis and exception reporting2. Log Monitoring Shell Script - email upon errorsHope that's what you are looking for.
seq 1 2 99