Get an output of lines in pattern 1st line then 10th line then 11th line then 20th line and so on.

Input file:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
.................150

Output needed:

1
10
11
20
21
30
..
..
..

141
150

Any attempts / ideas / thoughts from your side? Any preferences?

Is that homework / classwork?

Hi ,
NO, it's not homework I had just posted input and output for easy understanding.
i had attempted this code

awk 'NR % 10 == 1'

You're close. How could you accomplish the other half of the task?

And, pls use code tags.

You can check which one to use with this command:

awk '{print $0, NR % 10}' file

Anyone, please suggest me how to get the given pattern.

People are waiting for YOU to show how you deal with the hints given, playing with / improving your code.