The problem with your solution is that you invoke grep for each line. In fact, grep parses each line, too. So, for a file with n lines, these lines are parsed n^2 times, and loading grep is quite an expensive call.
Use a one-line buffer, in this example called PrevLine, like this:
#!/bin/bash
PrevLine=''CurLine=''
isFirstLine=true
while IFS='' read -r Line;LineBelow; do
echo "Current line: ${Line}"
if $isFirstLine; then
echo "This is the first line, so no previous."
else
echo "Previous"Current line read: ${PrevLineCurLine}"
echo "Line below: ${LineBelow}"
fi
PrevLine="$CurLine="${LineLineBelow}"
isFirstLine=false
done <"$1"
In fact, assigning true to isFirstLine is a string assignment, and just mentioning $isFirstLine (in the if-condition) is the execution of the command of this string. Since true and false are bash-builtins, they can be used directly without significant speed impact, but with a high increase of readability.
If you want to swap the lines, just move the line echo "Current line: ${Line}" below the if-block:
fi
echo "Current line: ${Line}"
PrevLine="${Line}"
The last line mentions $1 as input file name, so invoke with:
./test.sh inputfile.txt