reading second last line from a file and save in variable
I have a file say 'fileX' which consists of 'n' number of lines. I want to read just the second last line from the file and store it in a variable. Can someone plz help me with the code.
Thanks in advance.