L1.p New
L1.p New
count=0
num=2
is_prime=1
is_prime=0
break
fi
done
count=$((count + 1))
fi
num=$((num + 1))
done
Write a shell script to perform the following string operations to find the length of a given string.
read str
# Prompt the user to enter the starting position and length of the substring
echo "Enter the starting position " read start_pos echo "Enter the length
read len
substring=${input_string:start_pos:len} # Display
Write a shell script to copy the contents of one file into another
echo "Enter the source file name: " read source_file echo "Enter
read num
temp=$num
sum=0
digits=${#num}
Write a shell script that takes a command –line argument and reports on whether it is directory, a
file, or something else.
else
Fi
Q—Sub String
read str
read start
read len
substr=$[str:start:len]