Index: src/main/java/org/apache/servicemix/kernel/gshell/core/history/HistoryCommand.java
===================================================================
--- src/main/java/org/apache/servicemix/kernel/gshell/core/history/HistoryCommand.java	(revision 0)
+++ src/main/java/org/apache/servicemix/kernel/gshell/core/history/HistoryCommand.java	(revision 0)
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.servicemix.kernel.gshell.core.history;
+
+
+import org.apache.geronimo.gshell.clp.Argument;
+import org.apache.geronimo.gshell.shell.ShellContextHolder;
+import org.apache.servicemix.kernel.gshell.core.OsgiCommandSupport;
+
+
+import jline.History;
+
+
+public class HistoryCommand
+    extends OsgiCommandSupport
+{
+    
+    @Argument(required = true, description = "The name prefix or index of history command")
+    private String arg;
+
+    protected Object doExecute() throws Exception {
+        History history = variables.get("gshell.internal.history", History.class);
+        assert history != null;
+        String historyCommand = null;
+        try {
+            int index = Integer.valueOf(arg).intValue();
+            historyCommand = (String) history.getHistoryList().get(index - 1);
+            
+        } catch (NumberFormatException e) {
+            //it's not index, try name prefix
+            for (int i = history.getHistoryList().size(); i > 0; i--) {
+                historyCommand = (String) history.getHistoryList().get(i - 1);
+                if (historyCommand.startsWith(arg)) {
+                    break;
+                }
+            }
+        }
+        ShellContextHolder.get().getShell().execute(historyCommand);
+        return null;
+    }
+    
+    
+}
+
+

Property changes on: src/main/java/org/apache/servicemix/kernel/gshell/core/history/HistoryCommand.java
___________________________________________________________________
Name: svn:keywords
   + Rev Date
Name: svn:eol-style
   + native

Index: src/main/resources/META-INF/spring/gshell-commands.xml
===================================================================
--- src/main/resources/META-INF/spring/gshell-commands.xml	(revision 764680)
+++ src/main/resources/META-INF/spring/gshell-commands.xml	(working copy)
@@ -119,13 +119,17 @@
         <gshell:command name="history">
             <gshell:action class="org.apache.geronimo.gshell.commands.builtin.HistoryAction"/>
         </gshell:command>
-
         <gshell:command name="info">
             <gshell:action class="org.apache.servicemix.kernel.gshell.core.commands.InfoAction">
                 <constructor-arg ref="branding" />
             </gshell:action>
         </gshell:command>
     </gshell:command-bundle>
+    <gshell:command-bundle>
+        <gshell:command name="!">
+            <gshell:action class="org.apache.servicemix.kernel.gshell.core.history.HistoryCommand"/>
+        </gshell:command>
+    </gshell:command-bundle>
 
     <gshell:command-bundle>
         <gshell:command name="ssh">
Index: src/main/resources/org/apache/servicemix/kernel/gshell/core/history/HistoryCommand.properties
===================================================================
--- src/main/resources/org/apache/servicemix/kernel/gshell/core/history/HistoryCommand.properties	(revision 0)
+++ src/main/resources/org/apache/servicemix/kernel/gshell/core/history/HistoryCommand.properties	(revision 0)
@@ -0,0 +1,24 @@
+##
+## Licensed to the Apache Software Foundation (ASF) under one
+## or more contributor license agreements.  See the NOTICE file
+## distributed with this work for additional information
+## regarding copyright ownership.  The ASF licenses this file
+## to you under the Apache License, Version 2.0 (the
+## "License"); you may not use this file except in compliance
+## with the License.  You may obtain a copy of the License at
+##
+##  http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing,
+## software distributed under the License is distributed on an
+## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+## KIND, either express or implied.  See the License for the
+## specific language governing permissions and limitations
+## under the License.
+##
+
+command.description=Fast access history command.
+
+command.manual=\
+  TODO: date manual
+

Property changes on: src/main/resources/org/apache/servicemix/kernel/gshell/core/history/HistoryCommand.properties
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:keywords
   + Rev Date
Name: svn:eol-style
   + native

