My problem is in a script which i'm writing to help a total novice set up fluxbox etc. Basically, someone buys an eeepc, hoses an eeepc, needs help rebuilding.. after 2 days over the phone I decide a script is easier.
Now, the fluxbox config/init file contains the startup files and ends with
This means everything needs to be prior to the 'exec' statement. My initial idea was just to use
Code:
value=$((`cat $fluxbox-config|wc -l`-1))
sed '$value i\hello' $fluxbox-config
but obviously this wont work. Is there a way of using a sort of
Code:
sed '-1i\hello' $fluxbox-config
to do the second to last line?
or is my best best bet to stick a bit of python or perl in there?