Skip to content
/ import Public
forked from importpw/import

`import` is a simple and fast module system for Bash and other Unix shells

Notifications You must be signed in to change notification settings

matchai/import

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

import

import is a simple and fast module system for Bash and other Unix shells.

Inspired by Go's import command, you specify the URL of the shell script, and the import function downloads the file and caches it to ~/.import-cache, forever.

The code will never change from below your feet, and will continute to work offline.

👋 Example

https://git.io/fAWiz ← This URL contains a simple add shell function:

add() {
  expr "$1" + "$2"
}

You can use the import function to download, cache, and use that function in your own script:

#!/usr/bin/env import

# The URL is downloaded once, cached forever, and then sourced
import https://git.io/fAWiz

add 20 22
# 42

⚙️ Compatibility

The core import function is fully POSIX-compliant, and maximum compatibility is the goal. import is unit tested against the following shell implementations:

  • ash - Almquist Shell (BusyBox ash and Debian dash)
  • ksh - KornShell (oksh, mksh and loksh flavors)
  • zsh - Z Shell
  • bash - GNU's Bourne Again SHell

📚 Documentation

About

`import` is a simple and fast module system for Bash and other Unix shells

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 91.2%
  • Dockerfile 8.8%