I tried to code something to solve this, it's not elegant at all and it doesn't always work but it's a start
tot=$(wc -l $TM_FILEPATH) tot=$(echo $tot | cut -d ' ' -f 1) echo $tot, $TM_LINE_NUMBER if [ $tot == $((TM_LINE_NUMBER - 1)) ] # we are at the end of the file then ruby -e 'puts "\n"*30' fi
If appears that we are at the end of the file it print 30 newlines. The problems are: - sometimes (wc -l) executed in this way gives me a wrong result (don't understand why) - the caret goes to the last line
When this will be solved for me it will be fine... Maybe would be better to use macros?