-
Notifications
You must be signed in to change notification settings - Fork 348
Shebang
dtmilano edited this page Apr 29, 2013
·
4 revisions
Shebang extends the standard shebang line functionality found on Linux, Mac OSX and Windows Cygwin allowing for use cases that would be otherwise impossible.
See the details at https://github.com/dtmilano/shebang
shebang can be used to simplify script creation and the way scripts locate AndroidViewClient modules.
A typical shebang for a script would be:
#! /usr/local/bin/shebang monkeyrunner -plugin $AVC_HOME/bin/androidviewclient-$AVC_VERSION.jar @!This shebang line uses:
- Absolute path of
shebangto enable the use of shebang line extensions -
monkeyrunnerset as the interpreter for the script -
$AVC_HOMEenvironment variable to locate AndroidViewClient installation (AVC_HOMEis used instead ofANDRODI_VIEW_CLIENT_HOMEto reduce the shebang command line length and prevent reaching Linux maximum length which isBINPRM_BUF_SIZE = 128) -
$AVC_VERSIONto specify the jar version to be used (AVC_VERSIONis used instead ofANDRODI_VIEW_CLIENT_VERSIONto reduce the shebang command line length and prevent reaching Linux maximum length which isBINPRM_BUF_SIZE = 128) -
@!to mark the end of shebang arguments
A typical shebang for a script would be:
#! /usr/bin/env shebang monkeyrunner -plugin $ANDROID_VIEW_CLIENT_HOME/bin/androidviewclient-$ANDROID_VIEW_CLIENT_VERSION.jar @!This shebang line uses:
- /usr/bin/env to look for
shebangexecutable inPATH -
shebangto enable the use of shebang line extensions -
monkeyrunnerset as the interpreter for the script -
$ANDROID_VIEW_CLIENT_HOMEenvironment variable to locate AndroidViewClient installation -
$ANDROID_VIEW_CLIENT_VERSIONto specify the jar version to be used -
@!to mark the end of shebang arguments
Using previous shebang command line permits to further simplify the imports as showed by this snippet:
#! /usr/bin/env shebang monkeyrunner -plugin $ANDROID_VIEW_CLIENT_HOME/bin/androidviewclient-$ANDROID_VIEW_CLIENT_VERSION.jar @!
from com.dtmilano.android.viewclient import ViewClient
...