Suppose I have the file temp.txt with the following content:
1
2
3
4
5
6
How would you read the file's content starting from line number 3 using BASH so that the output would be like this:
3
4
5
6
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.
Sign up to join this communitySuppose I have the file temp.txt with the following content:
1
2
3
4
5
6
How would you read the file's content starting from line number 3 using BASH so that the output would be like this:
3
4
5
6
A bash-only solution (for the sake of fun):
#!/bin/bash
C=1
DONE=false
until $DONE ;do
read LINE || DONE=true
if [ "$C" -ge "$1" ]; then
printf "%s\n" $LINE
fi
C=$(($C+1))
done