[bash] remove lines from a file
I am trying to write a script to generate a menu for XFce4 on the fly when I login.
My goal is to generate a menu using Menu Maker and append that to a base menu I have created. The problem with appending is that the automatically generated file, menuAuto.xml, has tags that prevent the resulting menu file from being a valid menu. I figure that if I wrote some script to remove the first 3 lines from menuAuto.xml, the append will work correctly. What code is necessary for a bash script to remove the first 3 lines from a file? Thanks in advance! I think this will be a neat little script once it is finished. |
Something like this...
#!/bin/bash MTMP=`wc -l long | awk '{print $1}'` NTMP=`expr $MTMP - 3` tail -n $NTMP filename |
Hey cool, that did it!
I will post a working script tomorrow. Thanks a lot for your help irish_rover; I really appreciate it! |
Final script code
Here is the final code for this script if anyone is interested.
Code:
#!/bin/bash |
All times are GMT -5. The time now is 02:57 PM. |