def system_raw(self, cmd):
    'Call the given cmd in a subprocess using os.system on Windows or\n        subprocess.call using the system shell on other platforms.\n\n        Parameters\n        ----------\n        cmd : str\n            Command to execute.\n        '
    cmd = self.var_expand(cmd, depth=1)
    main_cmd = cmd.split()[0]
    has_magic_alternatives = ('pip', 'conda', 'cd')
    if (main_cmd in has_magic_alternatives):
        warnings.warn('You executed the system command !{0} which may not work as expected. Try the IPython magic %{0} instead.'.format(main_cmd))
    if (sys.platform == 'win32'):
        from IPython.utils._process_win32 import AvoidUNCPath
        with AvoidUNCPath() as path:
            if (path is not None):
                cmd = ('"pushd %s &&"%s' % (path, cmd))
            try:
                ec = os.system(cmd)
            except KeyboardInterrupt:
                print(('\n' + self.get_exception_only()), file=sys.stderr)
                ec = (- 2)
    else:
        executable = os.environ.get('SHELL', None)
        try:
            ec = subprocess.call(cmd, shell=True, executable=executable)
        except KeyboardInterrupt:
            print(('\n' + self.get_exception_only()), file=sys.stderr)
            ec = 130
        if (ec > 128):
            ec = (- (ec - 128))
    self.user_ns['_exit_code'] = ec
Call the given cmd in a subprocess using os.system on Windows or
subprocess.call using the system shell on other platforms.

Parameters
----------
cmd : str
    Command to execute.
def system_raw(self, cmd):
    'Call the given cmd in a subprocess using os.system on Windows or\n        subprocess.call using the system shell on other platforms.\n\n        Parameters\n        ----------\n        cmd : str\n            Command to execute.\n        '
    cmd = self.var_expand(cmd, depth=1)
    main_cmd = cmd.split()[0]
    has_magic_alternatives = ('pip', 'conda', 'cd')
    if (main_cmd in has_magic_alternatives):
        warnings.warn('You executed the system command !{0} which may not work as expected. Try the IPython magic %{0} instead.'.format(main_cmd))
    if (sys.platform == 'win32'):
        from IPython.utils._process_win32 import AvoidUNCPath
        with AvoidUNCPath() as path:
            if (path is not None):
                cmd = ('"pushd %s &&"%s' % (path, cmd))
            try:
                ec = os.system(cmd)
            except KeyboardInterrupt:
                print(('\n' + self.get_exception_only()), file=sys.stderr)
                ec = (- 2)
    else:
        executable = os.environ.get('SHELL', None)
        try:
            ec = subprocess.call(cmd, shell=True, executable=executable)
        except KeyboardInterrupt:
            print(('\n' + self.get_exception_only()), file=sys.stderr)
            ec = 130
        if (ec > 128):
            ec = (- (ec - 128))
    self.user_ns['_exit_code'] = ec