How run simple command in xterm, and leave open?

I have written a simple script to show battery life remaining. I would like to be able to quickly view it with a predefined keybinding or launcher.

xterm -e scriptname should do the trick but the xterm closes when the script finishes, not giving me chance to read the output. How can I keep it open, ideally for a fixed period of time (2 seconds for example)?

Here is the script if it helps -

#!/bin/bash
A=$(cat /proc/acpi/battery/BAT0/info | awk '/last full capacity/{print $4}') ;
B=$(cat /proc/acpi/battery/BAT0/state | awk '/remaining capacity/{print $3}') ; 

let C=$B*100/$A ; 
echo "$C%"

Thanks in advance

spoov

Put a sleep 2 command in the script as the last thing. 2 seconds seems like a short time, but you can tweak the sleep command as you desire.

try to add this line to the end of your script:

read -s -n1 -p "press any key to close..."

Now i've had time to check, neither option works. I assumed one of them would but no. !

Must be something to do with the -e switch, it doesn't matter what command you put afterwards it seems only the first one gets run before the xterm closes.

If I run the script from a terminal I get the same behaviour (ie xterm opens then closes in a flash) but the command is also repeated in the running terminal.