Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/johnsonjh/cbexec
cbexec: A universal shebang wrapper, switching based on file extension
https://github.com/johnsonjh/cbexec
cbexec exec hack interp shebang unix
Last synced: about 1 month ago
JSON representation
cbexec: A universal shebang wrapper, switching based on file extension
- Host: GitHub
- URL: https://github.com/johnsonjh/cbexec
- Owner: johnsonjh
- License: gpl-2.0
- Created: 2021-06-22T08:47:45.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-04-12T15:23:49.000Z (almost 3 years ago)
- Last Synced: 2024-11-02T09:42:11.350Z (3 months ago)
- Topics: cbexec, exec, hack, interp, shebang, unix
- Language: Shell
- Homepage:
- Size: 34.2 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# cbexec
A universal shebang wrapper (_and gross hack_),
switching interpreters based on file extension.---
## Examples
### Bash
```bash
#!/usr/bin/env cbexecbuiltin printf '%s\n' \
"Hello Bash World!"
```---
### C
```d
#!/usr/bin/env cbexec#include
int main() {
printf("Hello C World!\n");
return 0;
}
```---
### COBOL
```sh
#!/usr/bin/env cbexecIDENTIFICATION DIVISION.
PROGRAM-ID. COBOL.
PROCEDURE DIVISION.
MAIN.
DISPLAY 'HELLO COBOL WORLD!' END-DISPLAY.
STOP RUN.
```---
### C++
```d
#!/usr/bin/env cbexec#include
int main()
{
std::cout << "Hello C++ World!" << std::endl;
return 0;
}
```---
### C Shell
```csh
#!/usr/bin/env cbexecset fignore = (.o \~) && set hw='Hello C Shell World!' && printf '%s\n' "$hw";
```---
### D
```d
#!/usr/bin/env cbexecimport std.stdio;
int main() {
writeln("Hello D World!");
return 0;
}
```---
### Emacs Lisp
```elisp
#!/usr/bin/env cbexec(message "Hello Emacs Lisp World!")
```---
### FORTRAN-90
```sh
#!/usr/bin/env cbexecprogram main
implicit none
write (*, '(a)') 'Hello FORTRAN-90 World!'
stop
end
```---
### FORTRAN-77
```sh
#!/usr/bin/env cbexecPROGRAM HELLOW
WRITE(UNIT=*,FMT='(A)')'HELLO FORTRAN-77 WORLD!'
STOP
END
```---
### Go
```sh
#!/usr/bin/env cbexecpackage main
import "fmt"
func main() {
fmt.Println("Hello Go World!")
}
```---
### Korn Shell
```ksh
#!/usr/bin/env cbexecPATH=""
print "Hello Korn Shell World!"
```---
### MATLAB / Octave
```sh
#!/usr/bin/env cbexecprintf("Hello MATLAB World!\n");
quit(0);
```---
### OCaml
```sh
#!/usr/bin/env cbexecprint_sring "Hello OCaml World!\n"
```---
### '"POSIX"' Shell
```sh
#!/usr/bin/env cbexec(
exec 2> /dev/null
time 1> /dev/null 2>&1 < /dev/null
) || {
XX="Hello POSIX Shell World!" :
printf '%s\n' "$XX"
} | grep POSIX
```---
### Z Shell
```zsh
#!/usr/bin/env cbexecPATH=""
- builtin print "Hello Z Shell World!"
```---