Skip to content
Programmingoneonone
Programmingoneonone

Learn everything about programming

  • Home
  • CS Subjects
    • Internet of Things (IoT)
    • Digital Communication
    • Human Values
  • Programming Tutorials
    • C Programming
    • Data structures and Algorithms
    • 100+ Java Programs
    • 100+ C Programs
  • HackerRank Solutions
    • HackerRank Algorithms Solutions
    • HackerRank C problems solutions
    • HackerRank C++ problems solutions
    • HackerRank Java problems solutions
    • HackerRank Python problems solutions
Programmingoneonone
Programmingoneonone

Learn everything about programming

Leetcode Tenth Line problem solution

YASH PAL, 31 July 2024

In this Leetcode Tenth Line problem solution we have Given a text file file.txt, print just the 10th line of the file.

Leetcode Tenth Line problem solution

First Problem solution.

LINE=1
while read -r CURRENT_LINE
do
if [ "$LINE" -eq "10" ]
then
echo $CURRENT_LINE
fi
((LINE++))
done < "./file.txt"

Second Problem solution.

cat file.txt | sed -n '10p'

Third Problem solution.

sed '10q;d' file.txt

coding problems solutions

Post navigation

Previous post
Next post

Pages

  • About US
  • Contact US
  • Privacy Policy

Follow US

  • YouTube
  • LinkedIn
  • Facebook
  • Pinterest
  • Instagram
©2025 Programmingoneonone | WordPress Theme by SuperbThemes