MCPcopy Create free account
hub / github.com/mininet/mininet / isShellBuiltin

Function isShellBuiltin

mininet/util.py:223–230  ·  view source on GitHub ↗

Return True if cmd is a bash builtin.

( cmd )

Source from the content-addressed store, hash-verified

221# pylint: enable=maybe-no-member
222
223def isShellBuiltin( cmd ):
224 "Return True if cmd is a bash builtin."
225 if isShellBuiltin.builtIns is None:
226 isShellBuiltin.builtIns = set(quietRun( 'bash -c enable' ).split())
227 space = cmd.find( ' ' )
228 if space > 0:
229 cmd = cmd[ :space]
230 return cmd in isShellBuiltin.builtIns
231
232
233isShellBuiltin.builtIns = None

Callers 1

sendCmdMethod · 0.90

Calls 1

quietRunFunction · 0.85

Tested by

no test coverage detected