p10.sh
#!/bin/bash
line1=`head -4 /etc/passwd`
line2=`tail -3 /etc/passwd`
echo -e "First 4 lines are :\n "
echo -e "$line1\n"
echo -e "Last 3 lines are:\n "
echo -e "$line2\n"
echo "Give Starting line: "
read starting_line
echo "Give End line: "
read end_line
line3=`sed -n "$a,$b p" /etc/passwd`
echo "Lines between starting and end line:\n "
echo -e "$line3"
#!/bin/bash
line1=`head -4 /etc/passwd`
line2=`tail -3 /etc/passwd`
echo -e "First 4 lines are :\n "
echo -e "$line1\n"
echo -e "Last 3 lines are:\n "
echo -e "$line2\n"
echo "Give Starting line: "
read starting_line
echo "Give End line: "
read end_line
line3=`sed -n "$a,$b p" /etc/passwd`
echo "Lines between starting and end line:\n "
echo -e "$line3"