Created
August 9, 2022 08:07
-
-
Save acid-bong/e23c5f0421b49b72df311e7b7efb14be to your computer and use it in GitHub Desktop.
VCC: edit the .c file (without the extension) and instantly recompile it and run. POSIX-compliant
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
vcc () { | |
vim "${1}.c" && | |
mkdir -p "$(dirname "${1}".c)"/bin && | |
cc -Wall -Wextra -o "$(dirname "${1}".c)"/bin/"$(basename "$1")" "${1}".c && | |
./"$(dirname "${1}".c)"/bin/"$(basename "$1")" | |
} | |
# Uncomment this if you intend to make it a script. Comment it/leave it commented if you source it in your .*shrc | |
#vcc "${1}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment