Bash $LINENO


Example

Outputs the line number in the current script. Mostly useful when debugging scripts.

#!/bin/bash
# this is line 2
echo something  # this is line 3
echo $LINENO # Will output 4