Documentation ¶
Overview ¶
Package shellscript contains helpers for dealing with shell scripts.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsPOSIXShell ¶
IsPOSIXShell attempts to detect POSIX-compliant shells (e.g bash, sh, zsh) from either a plain command line, or a shebang line.
Examples:
- IsPOSIXShell("/bin/sh") == true
- IsPOSIXShell("/bin/fish") == false
- IsPOSIXShell("#!/usr/bin/env bash") == true
- IsPOSIXShell("#!/usr/bin/env python3") == false
func ShebangLine ¶
ShebangLine extracts the shebang line from the file, if present. If the file is readable but contains no shebang line, it will return an empty string. Non-nil errors only reflect an inability to read the file.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.