As Ignacio said, use !!, but if you insist:
$(history | sed '$d' | sed -n '$p' | cut -d ' ' -f 3-)
Explanation:
$() executes the output of the command inside
sed '$d' deletes the last command, i.e. 2001 $(history | sed '$d' | sed -n '$p' | cut -d ' ' -f 3-)
sed -n '$p' prints only the last line, i.e. 2000 yourpreviouscommand
cut -d ' ' -f 3- removes the first three fields, separated by spaces, i.e. <space>2000<space>
I think it can be made more concise and robust, but it works for now.
Edit: If you want to use history instead of !! because the shell you're using doesn't have !!, you're out of luck; history is a shell built-in, not a program. And simple shells are not likely to have it if they don't have !!. For example, dash doesn't:
imgx64@home:~$ dash
$ history
dash: history: not found
$
uparrow key does the work for me. – alfasin Oct 22 '12 at 0:49