From 0fca442eeead2bdd99df7f84412db077d8e2c875 Mon Sep 17 00:00:00 2001 From: Saumit Dinesan Date: Wed, 30 Mar 2022 11:23:59 +0530 Subject: adding c/c++ compile alias-like script --- .scripts/compile | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 .scripts/compile (limited to '.scripts/compile') diff --git a/.scripts/compile b/.scripts/compile new file mode 100755 index 0000000..b64016f --- /dev/null +++ b/.scripts/compile @@ -0,0 +1,12 @@ +#!/bin/sh + +if [ -z "$1" ]; then + echo "enter a correct .cpp file" + exit +else + file="$1" +fi +output=$(echo "$1" | cut -d "." -f1) +echo "$file" +echo "$output" +gcc -o $output $file -lstdc++ -- cgit v1.2.3