Skip to content

Instantly share code, notes, and snippets.

@gkthiruvathukal
Created May 10, 2021 13:39
Show Gist options
  • Save gkthiruvathukal/266cc983c7f1ea96819121edb2e1046c to your computer and use it in GitHub Desktop.
Save gkthiruvathukal/266cc983c7f1ea96819121edb2e1046c to your computer and use it in GitHub Desktop.
SCRIPT=$0
function get_line_self() {
local FILENAME=$1
local LN=$(($2 - 1))
local INFO=( $(sed "${LN}q;d" $FILENAME) )
echo ${INFO[0]}
}
### Comment
echo $(get_line_self $0 $LINENO)
#### Another Comment
echo $(get_line_self $0 $LINENO)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment