VirtualBox

Changeset 21768 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Jul 22, 2009 2:13:35 PM (16 years ago)
Author:
vboxsync
Message:

Python shell: shell command

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxShell/vboxshell.py

    r21767 r21768  
    816816
    817817
     818def shellCmd(ctx, args):
     819    if (len(args) < 2):
     820        print "usage: shell <commands>"
     821        return 0
     822    cmd = ' '.join(args[1:])
     823    try:
     824        os.system(cmd)
     825    except KeyboardInterrupt:
     826        # to allow shell command interruption
     827        pass
     828    return 0
     829
     830
    818831def connectCmd(ctx, args):
    819832    if (len(args) > 4):
     
    897910            'reloadExt':['Reload custom extensions: reloadExt', reloadExtCmd, 0],
    898911            'runScript':['Run VBox script: runScript script.vbox', runScriptCmd, 0],
    899             'sleep':['Sleep for specified number of seconds: sleep <secs>', sleepCmd, 0],
     912            'sleep':['Sleep for specified number of seconds: sleep 3.14159', sleepCmd, 0],
     913            'shell':['Execute external shell comman: shell "ls /etc/rc*"', shellCmd, 0]
    900914            }
    901915
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette