{"repo":"ryanmjacobs/c","free":true,"listed":false,"github":"https://github.com/ryanmjacobs/c","clone":"git clone https://github.com/ryanmjacobs/c.git","description":"Compile and execute C \"scripts\" in one go!","language":"Shell","stars":2182,"topics":["cli","tcc","clang","gcc","compiler","script","c","cpp"],"license":"MIT","category":"cli-tools","readme_excerpt":"c \"There isn't much that's special about C. That's one of the reasons why it's fast.\" I love C for its raw speed (although it does have its drawbacks). We should all write more C. With this shell script, you can compile and execute C \"scripts\" in one go! (Oh yeah, and it works for C++ too.) Here's a simple example: Run it by typing: Or, call it from the shebang! Hooked? Here's how to install it: Use a package manager? Check here. For the entire system: For your local user only: Note: if you install it somewhere other than /usr/bin/c , then your shebang will be different. For example it may be something more similar to #!/home/ryan/.bin/c . Okay, how do I use it? c will use whatever $CC is set to. You can change this with: CLI Multiple Files - CLI Anything you want passed to the compiler, put in quotes as the first argument. Whether they're flags ( -Wall , -O2 , etc.) or file names ( file.c , main.c , etc.). Single File - CLI With only one file, omit the quotes: Shebang! After adding a shebang, just set the file to executable and it's ready to run. Single File - Shebang Add this to the top of your C file: Multiple Files - Shebang Just tack on any extra flags, options, or files you want passed to the compiler. Then be sure to add the terminating -- characters. Caching The default cache size is set to 5 MB. You can change this with: The default cache path is set to $TMPDIR/c.cache . You can change this with: Clear cache You can clear the cache with the --clear-cache flag: Contri","default_branch":null,"files":null,"tree":[],"storefront":"/r/ryanmjacobs","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/ryanmjacobs/c/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}